stackblogger / jwt-auth-boilerplate

A Node.Js boilerplate built using Express.Js framework to provide a skeleton of User Authentication using JSON Web Token (JWT) library.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jwt-auth-boilerplate

A Node.Js boilerplate built using Express.Js framework to provide a skeleton of User Authentication using JSON Web Token (JWT) library.

Getting Started

The easiest way to get started is to clone the repository:

# Get the latest snapshot
git clone https://github.com/jimcute/jwt-auth-boilerplate.git

# Change directory
cd jwt-auth-boilerplate

# Install NPM dependencies
npm install

# Then simply start your app
node app.js

Features

  • Local Authentication using Email and Password
  • MVC Project Structure
  • JWT Authentication

Register API

Type: POST
Parameters: email, password, firstname, lastname

# Call the API using Postman with the required parameters
http://localhost:3000/api/auth/register

Login API

Type: POST
Parameters: email, password

# Call the API using Postman with the required parameters
http://localhost:3000/api/auth/login

Get Logged-In User Profile

Type: GET
Headers: x-access-token

# Call the API using Postman with the required parameters
http://localhost:3000/api/v1/me

About

A Node.Js boilerplate built using Express.Js framework to provide a skeleton of User Authentication using JSON Web Token (JWT) library.


Languages

Language:JavaScript 100.0%