WebAPI
Simple web application created using DTLib.Web.
Important
Restart web application once per day to delete outdated data and clean RAM.
Config
ZstdCompressionLevel in config.json - zstd level of stored parsed save data (default 10)
SaveUpload section of config.json:
MaxSizeCompressedMegabytes- max size of uploaded.tar.zstin MiB (default 60)MaxSizePlainTextMegabytes- max size of the game data entry after decompression in MiB (default 200)
Routes
POST /uploadSave
- Query Params:
game- short name of the game (see ../README.md)originalFileType-text|ziporiginalFileName- name of the original save file (max 255 characters)
- Request Body:
application/zstd- single zstd frame containing a tar with files of the original save. Game data is read from the entry named in GameSaveEntryNames (gamestatefor EU4). A plain text save is a tar with just that one entry. The blob is stored byte-for-byte and can be downloaded with/getSaveFile. - Response:
or
{ "id": "string" }{ "errorMessage": "string" }(status 413 if upload or uncompressed game data exceeds the limits from config)
GET /getSaveStatus
- Query Params:
id- id of uploaded save file
- Response: SaveFileMetadata
{ "id": "string", "game": "string", "status": "initialized | uploaded | parsing | saving_results | done | error", "uploadDateTime": "string", "originalFileType": "text | zip", "originalFileName": "string", "errorMessage": "string?" }
GET /getSaveFile
- Query Params:
id- id of uploaded save file
- Response:
application/zstd- uploaded blob, unchanged or{ "errorMessage": "string" }
GET /getSaveData
- Query Params:
id- id of uploaded save file
- Response:
application/zstd- single zstd frame containing json:or{ "key0": [ "objects" ], "key1": [ "objects" ], }{ "errorMessage": "string" }