juanfril / A-team-project

0 stars 0 forks source link

A-team-project for job&talent/devaway

CI/CD Development

This project has been created to help people find the best job ever.

Installation:

If you get some errors when you run the docker-compose, pay attention with:

You can find the deployed project at: http://ec2-52-59-191-81.eu-central-1.compute.amazonaws.com/

Methods:


Get all users (Token required):
http://ec2-52-59-191-81.eu-central-1.compute.amazonaws.com//api/users
Method: 'GET'


Get one user (Token required):
http://ec2-52-59-191-81.eu-central-1.compute.amazonaws.com//api/users/:id

Body to add one user:
http://ec2-52-59-191-81.eu-central-1.compute.amazonaws.com//api/users
Method: 'POST'

{
  "firstName": "someone",
  "surNames": "onesurname",
  "email": "example@gmail.com",
  "password": "DSdasjfl5467kdsjafs",
  "phone": "666111222",
  "address": "Some address, 5"
}

Your output should be something like that:

  [
    {
        "id": "a66fd6fb-b86c-49e2-8dad-f01ba51b41c4",
        "firstName": "someone",
        "surNames": "onesurname",
        "email": "example@gmail.com",
        "phone": "666111222",
        "address": "Some address, 5",
        "role": "USER",
    }
]

Body to login user: http://ec2-52-59-191-81.eu-central-1.compute.amazonaws.com/api/users/login
Method: 'POST'

{
  "email": "example@gmail.com",
  "password": "DSdasjfl5467kdsjafs",
}

In your output, you can see a token:

  {
      "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbWFpbCI6InN1ZGRyQGdtYWlsLmNvbSIsInBhc3N3b3JkIjoiM2VkUTJXIiwiaWF0IjoxNjUxNTcwNTI4LCJleHAiOjE2NTE1NzA1NjN9.vTCQGPs2IQ9zFHu2H2pczR6oPiKvMSxS459YmtaCM5Q"
  }

With this token you can access to 'getAllUsers' and 'getOneUser' endpoints. The token will expire after 15 minutes.

Enjoy 😇