Basic API REST running with Docker and MongoDB. There is an user model implemented, you can perform methods GET, PUT, DELETE, POST on it.
The API works with
Clone the repository
$ git clone [email protected]:lebroz/api-basic.git
To install Docker
it's here
To install Docker-Compose
it's here
$ yarn run-docker
The port of MongoDB is set to 27017
by default.
First, install the dependencies using the packet manager yarn
,
$ yarn
Then,
$ yarn start
When you execute yarn start
an environment file .env
is generated with a random port you can change anytime
Create an user
{
"email": "EMAIL_HERE",
"password: "PASSWORD_HERE"
}
Update an user
You need a authorisation token
Authorization: Bearer ${token}
{
"email": "NEW_EMAIL_HERE",
"password: "NEW_PASSWORD_HERE"
}
Delete an user
You need a authorisation token
Authorization: Bearer ${token}
Retrieve all users
You need a authorisation token
Authorization: Bearer ${token}
Authenticate an user
{
"email": "EMAIL_HERE",
"password: "PASSWORD_HERE"
}