ArM character server implementation using Haskell and Swish. Still in early stages of construction.
There is a very crude client included, intended mainly for testing.
The easiest way to run the program is via cabal:
cabal run
It starts a web server on port 3000.
The most convenient way to test it is probably the
HTTPie tool.
% http get :3000/
HTTP/1.1 200 OK
Content-Type: text/plain; charset=utf-8
Date: Thu, 21 Apr 2022 20:51:46 GMT
Server: Warp/3.3.20
Transfer-Encoding: chunked
Test a get call - available paths for get:
/ (this page)
/graph
/initial
Testing PUT calls is a bit tricky, as http
does not read from the terminal,
but the following does work (as an example):
cat | http put :3000/adv
{
"advancementcontents": {
"arm:atSeason": "Autumn",
"arm:awardsXP": 16,
"arm:hasAdvancementDescription": "Studies Mentem L16 Q13 +3",
"arm:hasAdvancementIndex": 100,
"arm:hasAdvancementType": {
"prefixedid": "arm:Reading"
},
"arm:hasAdvancementTypeString": "Reading",
"arm:inYear": 1217
},
"advancementid": "<https://hg.schaathun.net/armchar/character/cieran#autumn1217adv>",
"advancementtraits": [
{
"arm:addedXP": 16,
"arm:hasLabel": "Mentem",
"arm:isSpecialTrait": {
"prefixedid": "arm:AccelleratedTrait"
},
"arm:prefixedid": "_:73",
"arm:traitClass": {
"prefixedid": "armr:mentem"
}
}
]
}
Obviously, if you have a JSON test file, you can redirect from file instead.
A couple of simple client scripts are provided in the client
subdirectory.
There are python scripts to generate off-line character sheets, a
simple put.sh
script to test updating of advancements API, and
putchar.sh
to test updating of other character data.
Main
uses ArM.Character.getAllCS
to create all the character sheets.ArM.CharacterMap.insertListS
FromJSON
Handle multiple characters and file output.