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
- Host: GitHub
- URL: https://github.com/mariosantosdev/learn-adonis-api
- Owner: mariosantosdev
- Created: 2022-02-28T04:49:56.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-01T04:58:47.000Z (over 4 years ago)
- Last Synced: 2025-01-03T08:47:53.647Z (over 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 94.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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`