Skip to content

API de autenticação, usando Nodejs, JWT, Mongo e Express

Notifications You must be signed in to change notification settings

Henrique1818/Authentication-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project RestAPI

Authentication System

Challenge proposed to create an API REST, user authentication


Index 📑

  1. About project
  2. How to use

About

Challenge proposed to create an API REST, user authentication


Demo Project

buscar update create login

Technology used


How to use

Requirements

Have Node.js installed on the machine.

How to install

  1. Download or clone the RestAPI repository
    git clone https://github.com/Henrique1818/Authentication-System.git
  1. Open the project in your preferred editor
  1. In your terminal, install the necessary packages:
    yarn

or

    npm install
  1. 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
  1. Great! Now you can go to the Authentication-System folder and start the server:
    cd Authentication-System

    yarn start

or

    npm start
  1. Open your browser! The RestAPI will be available at http://localhost:3000/singin

EndPoints

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"
    }

Author

Henrique 👾

Github | Instagram ❤️