An API written in Express.
- OSX:
brew install node
- Ubuntu:
apt-get install nodejs
You will need to use npm here.
You can find the list of dependencies for any Node project in its package.json
file. To install them, simply
run:
npm install
Also Install the dependencies if not installed properly
This will download all the Node libraries you need, and place them into the node_modules/
directory at the base of the project. node
can access them so long as you run it in somewhere in
the project dir; if you want to see for yourself, open the Node REPL by running node
with no
arguments while in the project directory, and try running const l = require('lodash')
—it will
place the lodash
library in the l
variable.
Run this command (which is defined in the scripts
section of package.json
):
npm run dev-start
Et voilà! Visit localhost:3000 to see everything in action.
If you are using VSCode, after running the dev server in your terminal, you can attach the VSCode debugger by clicking the debug panel and then hitting the play button using the "Attach debugger" configuration.
Otherwise, you can figure out how to attach your own debugger to Node's built-in inspector, which should work on port 9229. I hear you can use Chrome to do this, but I haven't researched how.
To insert a breakpoint, just add the line debugger
to your code.
For every feature this is how you should work -
- You are on master
git pull
git checkout -b <branch_name>
- Make your changes
git add -A
git commit -m "put in a commit message"
- The first time that you push a branch, you need to run
git push -u origin <branch_name>
For ALL OTHER TIMES, you just need to dogit push
- In Github, OPEN A NEW PULL REQUEST.
- Get somebody (your team lead) to REVIEW THE CODE.
Ensure all the proper environment variables are present, and then run:
npm start
Until you add more, these ones are necessary for a production deploy:
PRIVKEY_CERT_LOC
andFULLCHAIN_CERT_LOC
: Location of SSL certificate files, as produced by LetsEncrypt'sautocert
scriptJWT_SECRET
: The secret used to produce JSON Web Tokens
Postman for Linux
Version 7.25.2