Environment Variables
Certain server features requires environment variables to be set. Please read the guides below to and set the variables that apply to you.
COLLAB_KEY
#
Required to be set when using using the server. This is used as the key to encode JWT tokens for users and context. It can be set to any string.
#
How to set environment variablesThere are a few different ways you can set environment variables.
dotenv
#
The easiest and most flexible way is using the dotenv NPM package.
First, create a .env
file next to your server root and add your environment variables to it like so:
Then, at the top of your server file, import the dotenv
package and call the config
function.
#
Command lineYou can also set your environment variables via the command line on Mac and Linux.
If you are using windows, you can use the cross-env package to make this work.
Simply add the env variable before your server execution script. Commonly this is done in the package.json
scripts section.
Mac and Linux:
Windows: