Skip to content

mrako/nodejs-mongodb-api-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Example using NodeJS and Mongo

Prerequisites

Install prerequisites

brew install node mongo
npm install grunt-cli -g

Setup

npm install

Running

grunt serve

Testing

grunt test

Requests

Signup

curl --data "[email protected]&password=test" http://localhost:9000/signup

Login

curl --data "[email protected]&password=test" http://localhost:9000/login

Posts

curl -H "Authorization: Bearer <yourbearertoken>" http://localhost:9000/posts

curl -H "Authorization: Bearer <yourbearertoken>" --data "name='I should print a boat'" http://localhost:9000/posts

Heroku

curl -H "Authorization: Bearer <yourbearertoken>" https://nodejs-mongodb-api-example.herokuapp.com/posts

Deploying to Heroku

heroku config:set JWT_SECRET=verysecretstring AWS_ACCESS_KEY_ID=yourawsaccesskey AWS_SECRET_ACCESS_KEY=yourawssecretkey
git push heroku master

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published