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

https://github.com/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.
https://github.com/stackblogger/jwt-auth-boilerplate

Last synced: 6 months ago
JSON representation

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

Awesome Lists containing this project

README

          

# 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:

```sh
# 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

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

### Login API

**Type:** POST

**Parameters:** email, password

```sh
# 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

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