Boilerplate Environment Variables Configuration

Environment variables can be used to control the behavior of the server application and specify certain settings. They can be set in the .env file in the root of the project. Example.env in the documents folder contains an example of such file.

Web Serving

Variable Name Description
PORT Port for serving the SPA web application and API.
HOST Host for for serving, for instance 127.0.0.1.
PUBLIC_URL URL through which browsers and other clients can access the server - isomorphic pages, public, GraphQL. Optional. Should not be empty. Example: https://example.com
USER_TOKEN_2_BYPASS_IP Requests coming from this IP will not be checked for User Token 2. This allows to use GraphiQL, however it can also be a security issue. By default it is set to 127.0.0.1 and should remain so in production

Security Tokens and Secrets

Variable Name Description
JWT_SECRET Secret used for JWT tokens.
SESSION_SECRET Secret used for express sessions. Rebar only, for logging in with Twitter.

Cassandra connection

Stripe online payments

This section applies to Rebar only.

Variable Name Description
PAYMENTS_STRIPE_SECRET_KEY Stripe secret key.
PAYMENTS_STRIPE_PUBLISHABLE_KEY Stripe publishable key.

Social Network login

This section applies to Rebar only. For more details refer to Login Using Social Networks.

Variable Name Description
FACEBOOK_APP_ID Facebook public, shareable key.
FACEBOOK_APP_SECRET Facebook private, secret key.
GOOGLE_CLIENT_ID Google public, shareable key.
GOOGLE_CLIENT_SECRET Google private, secret key.
TWITTER_CONSUMER_KEY Twitter public, shareable key.
TWITTER_CONSUMER_SECRET Twitter private, secret key.