Skip to content

jsollasvaara/nodejs-mongodb-api-example

This branch is up to date with mrako/nodejs-mongodb-api-example:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6dfb790 · Sep 19, 2015

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

Languages

  • JavaScript 100.0%