statico/ifhttp
👾 HTTP REST server for Z-Machine interactive fiction
{ "createdAt": "2016-11-12T04:13:38Z", "defaultBranch": "main", "description": "👾 HTTP REST server for Z-Machine interactive fiction", "fullName": "statico/ifhttp", "homepage": "https://langworth.com/", "language": "JavaScript", "name": "ifhttp", "pushedAt": "2023-02-08T06:58:29Z", "stargazersCount": 13, "topics": [ "docker", "http", "http-server", "if", "inform", "inform7", "interactive-fiction", "rest", "z-machine", "z8" ], "updatedAt": "2025-04-23T23:19:05Z", "url": "https://github.com/statico/ifhttp"}ifhttp
Section titled “ifhttp”ifhttp provides an HTTP REST interface for interacting with Z-Machine interactive fiction (IF) stories (typically .z8 files). Clients can connect to the service to start a game and then POST commands to it. Sessions are deleted after a while in a feeble attempt to save memory. This service is definitely DoS-able.
See a live example on https://www.langworth.com/
$ docker pull ghcr.io/statico/ifhttp$ docker run -p 8080:8080 -v /path/to/stories:/data ghcr.io/statico/ifhttp npm run -s start -- /data/story.z8All request and response bodies should be JSON. In addition to a status code, requests may return a JSON object with an error property which describes the error.
GET /new
Section titled “GET /new”Returns a session ID for a new game.
Response:
{ "session": "<id>", "output": "<text>"}POST /send
Section titled “POST /send”Sends a command to the game.
Request:
{ "session": "<id>", "message": "<user input>"}Response:
{ "output": "<text>"}