Skip to content

CENTneRMOB/Quantori_boot_camp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Quantori JS Boot Camp Backend

How to startup:

  1. Docker and docker-compose needed locally
  2. Download this repository

Use below terminal commands in directory with the repository source code:

  1. Start containers:
docker-compose up --build
  1. Wait until this log appears:
LOG [NestApplication] Nest application successfully started
  1. Go to browser or any other app you prefer to test API. the application will be available on http://localhost:8080

There are 5 users in database. Use any one for requests:

{
  "email": "[email protected]",
  "username": "Andrew",
  "password": "andrewPassword1"
}
{
  "email": "[email protected]",
  "username": "Bob",
  "password": "bobPassword1"
}
{
  "email": "[email protected]",
  "username": "Denis",
  "password": "denisPassword1"
}
{
  "email": "[email protected]",
  "username": "John",
  "password": "johnPassword1"
}
{
  "email": "[email protected]",
  "username": "Kate",
  "password": "katePassword1"
}

Description

Use POST requests to get tokens. Use tokens in GET requests.

Examples

POST request to get token:
curl -X POST http://localhost:8080/login -d '{"email": "[email protected]", "password": "andrewPassword1"}' -H "Content-Type: application/json"
Received token(don't use this token, it is not a constant value)
$2b$10$25zGleOJ2Evkr1XDqwyhAOJcK5ZXpkbPRAz0hvb8jdQGkE43QPHlG
GET request to get profile('\' are for escaping $):
curl -H "Authorization: Bearer \$2b\$10\$25zGleOJ2Evkr1XDqwyhAOJcK5ZXpkbPRAz0hvb8jdQGkE43QPHlG" http://localhost:8080/profile
Full GET request:
> GET /profile HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.81.0
> Accept: */*
> Authorization: Bearer $2b$10$25zGleOJ2Evkr1XDqwyhAOJcK5ZXpkbPRAz0hvb8jdQGkE43QPHlG
Received data:
{"email":"[email protected]","username":"Andrew"}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors