Home

Awesome

Simple Node JWT-Token Authentication starter kit.

alt tag

This repo uses JSON Web Tokens and the jsonwebtoken package to implement token based authentication on a simple Node.js API with a MongoDB Database.

This is a starting point to have an API up and running in notime.

The Api Features:

- JWT Auth Token
- User Management

##Installation

###With Docker

###Without Docker

This project needs NodeJS > v5.0.0, MongoDB and forever to manage the process.

##API

###Setup test user

To setup an admin user edit your .env file and request the url http://localhost:8282/setup

curl http://localhost:8282/setup

###Versioning

###Authenticate

To authenticate a user do a POST request to http://localhost:8282/auth with the name and the password in the body

{
	name:"jwtauth",
	password:"jwtauth"

}

curl -H "Content-Type: application/json" -X GET http://localhost:8080/setup curl -H "Content-Type: application/json" -X POST -d '{ "name":"user","password":"password"}' http://localhost:8080/api/auth