Authentication API Service. Built with NodeJS, Express, and Docker. Connects to the MongoDB User Database.
$ git clone https://github.com/llama-as-a-service/auth-service.git
$ cd auth-service
$ cp .env.sample .env
$ docker-compose up -d
# access on localhost:7007
$ docker-compose exec auth_service yarn run test
# docker pull ghcr.io/OWNER/IMAGE_NAME
$ docker pull ghcr.io/llama-as-a-service/auth-service:0.1.0
URL | /register |
---|---|
Method | POST |
Status | 201 OK |
{
"last_name": "Deer",
"first_name": "John",
"email": "john123@deer.com",
"password": "deer"
}
{
"first_name": "John",
"last_name": "Deer",
"email": "john123@deer.com",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiNjJjYWRlMDMxMjgxNGRiMzc1ODY4ZmI2IiwiZW1haWwiOiJqb2huMTIzQGRlZXIuY29tIiwiaWF0IjoxNjU3NDYyMjc1LCJleHAiOjE2NTc0Njk0NzV9.6cbolc6eCVvK5PnlCew47K_ZjHvZT4EsjQiTt5jBG_8"
}
URL | /authenticate |
---|---|
Method | POST |
Status | 200 OK |
{
"token": "eyJhbGciOiJIUzI1NiIsIn..."
}
{
"message": "Successfully authenticated",
"status": "success"
}
URL | /login |
---|---|
Method | POST |
Status | 200 OK |
{
"email": "john@gmail.com",
"password": "01494813"
}
{
"first_name": "Johnsdf",
"last_name": "Deer",
"email": "john123@deer.com",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiNjJjYWRlMDMxMjgxNGRiMzc1ODY4ZmI2IiwiZW1haWwiOiJqb2huMTIzQGRlZXIuY29tIiwiaWF0IjoxNjU3NDYzMzE1LCJleHAiOjE2NTc0NzA1MTV9.bVhocLT8V5UZaX-HpxbhlBuqu3L3dr0YfJhaOJStfvw"
}
$ yarn install
$ yarn run start # yarn run dev