Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fintank/node-rest-mongo-jwt

REST API with Node.js and MongoDB using JWT for authentication
https://github.com/fintank/node-rest-mongo-jwt

Last synced: 2 days ago
JSON representation

REST API with Node.js and MongoDB using JWT for authentication

Awesome Lists containing this project

README

        

Node.js REST API with JWT (JSON web token authentication)
---------------------------------------------------------

Note: Make sure your mongodb service is running.

Components

- MongoDB Database
- Node.js

Check 'package.json' for Node module dependencies

Installation
------------

> npm install

Visit http://localhost:3000/setup in your browser to populate the admin user for the database.

Running the application
------------------------

In the root directory

> npm install nodemon -g
> nodemon server.js

(Changes will reload automatically)

or alternatively

> node server.js

Endpoints
----------

GET http://localhost:3000/api
POST http://localhost:3000/api/auth
GET http://localhost:3000/api/users

Useful links
------------

Mongodb connection strings - https://docs.mongodb.org/v3.0/reference/connection-string/