-
node v18.3.0 -
.envfile with the following entries:-
DISCORD_OAUTH_CLIENT_ID
- the applications client id
-
DISCORD_OAUTH_SECRET
- the applications client secret
-
DISCORD_CALLBACK_URL
- the callback url specified in your oauth2 url
-
DISCORD_TOKEN
- your discord bots token
-
PORT
- the port on which the server will listen
-
SESSION_SECRET
- the session secret used to sign the session cookie
-
MONGO_URL
- a connection string to the mongodb database
- if authentication is needed, make sure the connection string has the right format, e.g.
mongodb://myusername:mypassword@127.0.0.1:27017/glue_discord?authSource=admin- the
authSourceparameter is necessary to authenticate against theadmindatabase - make sure you avoid special characters in the password as it leads to annoying complications
- the
-
BACKEND_CANISTER_ID
- the canister id of the
gluebackend canister, use the local canister id when developing and a canister from the mainnet when deploying to production
- the canister id of the
-
HOST
- in a node environment we have to specify a host for the agent to work, use the hostname of your local deployment ofthe glue frontend for development and
https://ic0.appfor production
- in a node environment we have to specify a host for the agent to work, use the hostname of your local deployment ofthe glue frontend for development and
-
NODE_ENV
developmentfor development andproductionfor production
-
- run
yarn installto install all dependencies - make sure the local deployment of glue is running
- run
yarn start:devto run a developmentnodemonserver (make sure your node version is correct, runnvm useif in doubt)
- run
yarn buildto build the express server - you can then use something like pm2 to deploy the server to production
- to make the express server listen to incoming request to your server, expose it using a
nginxreverse proxy⚠️ when using nginx reverse proxy: make sure you set the correct proxy headers fornginxand trust proxy setting forexpresslike here!
