Skip to content

Instantly share code, notes, and snippets.

@nlaz
Created February 4, 2017 15:57
Show Gist options
  • Save nlaz/52117c0d4a88fe31961374c4ac7b3225 to your computer and use it in GitHub Desktop.
Save nlaz/52117c0d4a88fe31961374c4ac7b3225 to your computer and use it in GitHub Desktop.

0. Setup

Setting up NPM

Package.json

Create a new folder for your project and open it:

$ mkdir test-project
$ cd test-project

You need to create and setup a new node project in this folder. Running npm init will guide you through setting the project information. You can just use the defaults for now.

$ npm init

This will add a file called package.json to your folder with all the information needed to run your application.

Packages

Now we want to install some Node packages so that we can get started. The three packages we need are:

  • [Mongoose] - A Node package to work with the MongoDB database within Javascript
  • [Express] - A middleware framework that allows us to build endpoints
  • [body-parser] - An addon to Express that allows us to configure the types of supported endpoint requests.

In order to install these packages, use the handy install command:

$ npm install --save express body-parse mongoose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment