- Docker and docker-compose needed locally
- Download this repository
- Start containers:
docker-compose up --build- Wait until this log appears:
LOG [NestApplication] Nest application successfully started
- Go to browser or any other app you prefer to test API. the application will be available on http://localhost:8080
{
"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"
}Use POST requests to get tokens. Use tokens in GET requests.
curl -X POST http://localhost:8080/login -d '{"email": "[email protected]", "password": "andrewPassword1"}' -H "Content-Type: application/json"$2b$10$25zGleOJ2Evkr1XDqwyhAOJcK5ZXpkbPRAz0hvb8jdQGkE43QPHlG
curl -H "Authorization: Bearer \$2b\$10\$25zGleOJ2Evkr1XDqwyhAOJcK5ZXpkbPRAz0hvb8jdQGkE43QPHlG" http://localhost:8080/profile> GET /profile HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.81.0
> Accept: */*
> Authorization: Bearer $2b$10$25zGleOJ2Evkr1XDqwyhAOJcK5ZXpkbPRAz0hvb8jdQGkE43QPHlG{"email":"[email protected]","username":"Andrew"}