An open API service indexing awesome lists of open source software.

https://github.com/mariosantosdev/learn-adonis-api

This repository was created to learn about the AdonisJS
https://github.com/mariosantosdev/learn-adonis-api

Last synced: 7 days ago
JSON representation

This repository was created to learn about the AdonisJS

Awesome Lists containing this project

README

          

# Learn Adonis Api

This repository was created to study about the restful api created with AdonisJS.

The goal is create an api that made authentication with `Name` and `Email` to be consumed by thirdy-applications. The authentication should return an API Token unique.

## Routes


METHOD
Endpoint
Header
Body
Response



POST
/register
null
{ name: string, email: string }
{ app: { id: number, name: string, email: string }, token: string }



POST
/generate-token
null
{ email: string }
{ token: string }



DELETE
/revoke-token
{ Authorization: Bearer `token` }
null
null



POST
/generate-people
{ Authorization: Bearer `token` }
null
{ name: string, username: string, email: string, phone: string, image: string, address: { street: string, state: string, country: string } }

## Using locally

1. Firstly, clone the repository to your computer

`git clone https://github.com/mariosantosdev/learn-adonis-api.git`

2. Open the folder of project

`cd learn-adonis-api`

3. Install all dependencies

```bash
# Remember use node version v14
npm install

# or yarn install
```

4. Change the filename `.env.example` to `.env`

5. Setup the SQLite database executing

`node ace migration:run`

6. Run the application with `npm run dev`