Environment Variables
src/start.mjs maps environment variables to start(options).
Supported Variables
PORT(default:3000)MODE(git,npm,url,local; default in starter isgit)GIT_CLONE_URLGIT_USERNAMEGIT_TOKENNPM_TARURL_TARSTART_SCRIPTFUNCTIONS_DIR_PATH(used whenMODE=local)BFAST_JSON_PATH(optional, used whenMODE=local)ASSETS_PATH(optional, used whenMODE=local)BFAST_BODY_LIMIT(JSON/form body size limit; default:2mb)BFAST_RAW_BODY(set totrueto expose the original JSON bytes as a Buffer atrequest.rawBodyfor webhook signature verification; disabled by default)
Examples
Git mode:
PORT=3000 \
MODE=git \
GIT_CLONE_URL=https://github.com/acme/functions.git \
GIT_USERNAME=acme-bot \
GIT_TOKEN=*** \
node src/start.mjsNPM mode:
PORT=3000 MODE=npm NPM_TAR=acme-functions node src/start.mjsRemote tarball mode:
PORT=3000 MODE=url URL_TAR=https://example.com/functions.tgz node src/start.mjsCustom script mode:
START_SCRIPT="node custom-server.js" node src/start.mjsLocal mode:
PORT=3000 \
MODE=local \
FUNCTIONS_DIR_PATH=./specs/sample_functions \
BFAST_JSON_PATH=./specs/sample_functions/bfast.json \
node src/start.mjs