Challenge proposed to create an API REST, user authentication
-
Frontend: ---- ----
-
Backend:
- Node.js
- Frameworks:
- Libraries, Packages and Package Managed:
-
Database:
Have Node.js installed on the machine.
- Download or clone the RestAPI repository
git clone https://github.com/Henrique1818/Authentication-System.git
- Open the project in your preferred editor
- In your terminal, install the necessary packages:
yarn
or
npm install
- Installing the MongoDB using Docker check if the docker is already installed on the machine
docker run --name database -p 27017:27017 -d mongo
docker run start database
create a database name => RestAPI
- Great! Now you can go to the Authentication-System folder and start the server:
cd Authentication-System
yarn start
or
npm start
- Open your browser! The RestAPI will be available at http://localhost:3000/singin
POST - Sing Up User: http://localhost:3000/admin/singup
{
"nome": "henrique",
"email": "henrique@teste.com",
"senha": "123456",
"telefones": [
{
"numero": 912345678,
"DDD": 11
},
{
"numero": 20202020,
"DDD": 14
}
]
}
GET - Sing In: http://localhost:3000/admin/singin
{
"email": "henrique@teste.com",
"senha": "123456"
}
GET - Search for User: http://localhost:3000/admin/:id
{
"nome": "Luiz henrique",
"email": "henrique@teste.com",
"senha": "1234",
"telefones": [
{
"numero": 912345611,
"DDD": 14
}
]
}
PUT - Updating User: http://localhost:3000/admin/update
{
"nome": "Luiz henrique",
"email": "henrique@teste.com",
"senha": "1234",
"telefones": [
{
"numero": 912345611,
"DDD": 14
}
]
}
DELETE - Removing User: http://localhost:3000/admin/:id
{
"message": "Deleted user"
}