Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

ifhttp

license Docker

ifhttp provides an HTTP REST interface for interacting with Z-Machine interactive fiction (IF) stories. 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/

Usage

$ docker pull statico/ifhttp
$ docker run -p 8080:8080 -v /path/to/stories:/data statico/ifhttp npm run -s start -- /data/story.z8

API

All 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

Returns a session ID for a new game.

Response:

{
  "session": "<id>",
  "output": "<text>"
}

POST /send

Sends a command to the game.

Request:

{
  "session": "<id>",
  "message": "<user input>"
}

Response:

{
  "output": "<text>"
}

Reference

  • Inform - IF creation toolsuite
  • ifvms - JavaScript Z-Machine VM used by this script
  • ifplayer - Command-line client which uses ifvms

Releases

No releases published

Packages

No packages published