Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# Express Authentication Service

This project provides a REST API using Express and Passport.js for authentication with Bearer tokens.

## Requirements

- Node.js
- npm

## Installation

1. Clone the repository:

```sh
git clone https://github.com/9ani/quant_back.git
cd quant_back
  1. Install dependencies:
npm install
  1. Create a .env file with the following content:
PORT=3000

Running the Project

To start the server:

npm start

The server will be running at http://localhost:3000.

Available API Endpoints

POST /api/login

Request body:

{
  "email": "user1@example.com",
  "password": "password1"
}

Response (success):

{
  "accessToken": "mockToken1"
}

Response (failure):

{
  "message": "Invalid email or password"
}

GET /api/profile

Requires a valid Bearer token. Use the accessToken obtained from /login.

Response (success):

{
  "email": "user1@example.com",
  "username": "user1"
}

Response (failure):

{
  "message": "Invalid token"
}

Test Users

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages