Skip to main content

The HTTP Gateway of the Storyscript platform

Project description

Storyscript HTTP Gateway

API gateway server for executing Stories via HTTP.

http server as server
  when server listen method:'get' path:'/' as r
    log info msg:r.body
    log info msg:r.headers
    log info msg:r.headers['Host']
    r write data:'Hello World'
    r status code:200
    r finish
$ curl
Hello World


Setup virtual environment and install dependencies

virtualenv -p python3.6 venv
source venv/bin/activate
pip install -r requirements.txt

You may need to tell pycurl the path to your openssl installation

pip install --install-option="--with-openssl" --install-option="--openssl-dir=/usr/local/opt/openssl" pycurl


Run locally by calling

python -m app.main --logging=debug --debug

Register an endpoint

curl --data '{"endpoint": "http://localhost:9000/story/foo", "data":{"path":"/ping", "method": "post", "host": "a"}}' \
     -H "Content-Type: application/json" \

Now access that endpoint

curl -X POST -d 'foobar' -H "Host:" http://localhost:8888/ping

Unregister an endpoint

curl --data '{"endpoint": "http://localhost:9000/story/foo", "data":{"path":"/ping", "method": "post", "host": "a"}}' \
     -H "Content-Type: application/json" \

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for story-http, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size story_http-0.2.0-py3-none-any.whl (16.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size story-http-0.2.0.tar.gz (10.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page