API gateway server for executing Stories via HTTP.
http server as server
when server listen method: 'get' path: '/' as req
log info msg: req.body
log info msg: req.headers
log info msg: req.headers['Host']
req write data: 'Hello World'
req status code: 200
req finish
curl https://foobar.storyscriptapp.com
>>> Hello World
Setup virtual environment and install dependencies
virtualenv -p python3.6 venv
source venv/bin/activate
pip install -r requirements.txt
Run locally by calling
python -m app.main --logging=debug --debug
curl --data '{"endpoint": "http://localhost:9000/story/foo", "data":{"path":"/ping", "method": "post", "host": "a"}}' \
-H "Content-Type: application/json" \
localhost:8889/register
Now access that endpoint
curl -X POST -d 'foobar' -H "Host: a.storyscriptapp.com" http://localhost:8888/ping
curl --data '{"endpoint": "http://localhost:9000/story/foo", "data":{"path":"/ping", "method": "post", "host": "a"}}' \
-H "Content-Type: application/json" \
localhost:8889/unregister
Content type
Image
Digest
Size
336 MB
Last updated
about 7 years ago
docker pull jeanbarriere/http