Tested on Node v6 and above This project uses boilerplate setup from https://github.com/kylealwyn/node-rest-api-boilerplate.git
- I did not have any issues with this setup, since I have working and project experience with NodeJS before. I used a boilerplate to setup some grounds, so I can mostly focus on the frontend. I could have also used Laravel, that I also have experience with, but NodeJS seemed to be a much better and quicker fit for this one.
First, ensure you have node is installed on your system. By default API connects to a remote MongoDB, so mongo is not necessary if you are not going to use a local db(check below)
Install dependencies
- npm install
Run it
- npm start (use node index.js if any issues)
Try it!
- Environment Variables
Place a
.env
file in the top level of the directory you've cloned. These variables will be automatically assigned toprocess.env
when the application boots. It is gitignored by default as it's not good practice to store your environment variables in your remote repository. Your.env
file can look something like this:
MONGO_URI=mongodb://somewhere:27017
SESSION_SECRET=lolthisissecret
Now we can access one of these variables with something like process.env.MONGO_URI
!
MIT