Skip to content

Repository files navigation

Simple Auth API with Express and JWT

This is a simple REST API that implements authentication using Express, PostgresSQL, JWT, and bcrypt.

Installation

  1. Clone the repository: github-link

  2. Navigate into the project directory:

  3. Install the dependencies:

  4. Set up your .env file with the appropriate values:

Usage

Register User:

  • Endpoint: POST /auth/register
  • Body: { "email": "user@example.com", "password": "password123", "surname": "yourSurname", "name": "New User" }

Login User:

  • Endpoint: POST /auth/login
  • Body: { "email": "user@example.com", "password": "password123" }

Protected Route (Example):

  • Endpoint: GET /protected
  • Header: Authorization: Bearer <token>
  • This route is protected, and requires a valid JWT token for access.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages