#!/bin/sh

export FAAS_API_KEY=FAASDEMO
export FAAS_API_SECRET=FAASDEMO
export FAAS_IX_API_DIR=faas_demo_apis
export FAAS_IX_DEVICE_KEY={{DEVICE_KEY}}

# export FAAS_IX_PROXY_HTTP_HOST=USE_PROXY # to use the upstream host as the http "Host:". For https upstreams, this is the default.
# export FAAS_IX_PROXY_HTTP_HOST=www.example.com # to set a specific http "Host:".

echo "Use this demo at: https://faasdemo-${FAAS_IX_DEVICE_KEY}.http-proxy.faas.io/"
echo ""

export PORT=8765

PATH=`npm bin`:${PATH}

node app.js &

faas-http-proxy http://localhost:${PORT}
