Skip to content

Instantly share code, notes, and snippets.

@jelizarovas
Last active July 29, 2019 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jelizarovas/d801d75cf4953e22ef6fd8e1f0ad2ed8 to your computer and use it in GitHub Desktop.
Save jelizarovas/d801d75cf4953e22ef6fd8e1f0ad2ed8 to your computer and use it in GitHub Desktop.
# sets up package.json file
npm init
# express is our main framework
# mongoose is used to connect/interact with MongoDB
# body-parser allows us to get the data throughout the request
# bcryptjs is a password hashing function designed by Niels Provos and David Mazières
# validation (as its name implies) is used for validation
npm i express mongoose body-parser bcryptjs validation
#nodemon is a utility that will monitor for any changes in your source and automatically restart your server.
npm i -D nodemon
#add .gitignore file
#taken from https://github.com/github/gitignore/blob/master/Node.gitignore 7/29/2019
node_modules/
#create app.js file in project directory
#add to package.json file:
"scripts": {
"start": "node app.js",
"app": "nodemon app.js",
}
# start server with following (run npm install if error)
npm run start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment