- node >=14.5.0
- mongodb >= v4.2
redis-server >= v4.0.9 (for socket.io and caching)wsl (only required on windows to run redis-server)
git clone <repo_url>
cd ./<project_directory>
mkdir -p ./.keys && cd ./.keys
On windows use git-bash or wsl
# Generate RSA256 certificate
ssh-keygen -t rsa -b 2048 -m PEM -f jwt_rsa.key
# Convert RSA256 public key to certificate
openssl rsa -in jwt_rsa.key -pubout -outform PEM -out jwt_rsa.key.pub
cd ..
npm i
List of dependencies can be found in
package.json
For config, see
Additional Configuration
- Debugging config for visual studio code is already included Press
F5
to start debugging
- By default, run-time exceptions will be logged to
./.logs/<NODE_ENV>/<YYYY>-<MM>/<YYYY>-<MM>-<DD>.json
To change logging to database see
Additional Configuration
- Build and place your frontend files in
/public
directory - All HTTP GET requests not matching with
^\/api*
will be redirected to/public/index.html
npm start # runs `npm run dev`
npm run dev # runs in development mode
npm run prod # runs in production mode
npm run prod-stop # stops in production mode
npm run prod-monit # `pm2 monit` in production
If you're using windows, please ensure that redis-server is running inside wsl before you run any of these commands >
wsl sudo service redis-server restart
Production mode uses
pm2
cluster-mode for load-balancing
See
scripts
inpackage.json
npm run test
npm run lint .
code --install-extension dbaeumer.vscode-eslint