Backend for our CS 565 project (name pending).
Install nvm, node.js, npm (MacOS/Linux, original reference):
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
# The below command may be needed so that nvm can be found by your shell
export NVM_DIR="$HOME/.nvm"
\. "$NVM_DIR/nvm.sh"
\. "$NVM_DIR/bash_completion"
nvm install --lts
Note that Windows will have to install a different way, see here.
Verify that the versions match these:
> node --version
v18.15.0
> npm --version
9.5.0
> nvm --version
0.39.3
Install all node packages:
npm ci
Create a .env
file at the root project directory with the following contents (note that it is in the .gitignore
and will be used to store secrets for development):
PORT=8000
# ask group for details
MONGO_CONNECTION=<authlink>
If using VSCode for development, installing ESLint would be helpful.
Testing can be done either through the browser or using the tool Postman.
To run the server for development with hot-reload:
npm run dev
To run the server in "production":
npx run build && npm start