Boilerplate/Starter Project for building RESTful APIs using Adonis, MySQL, JWT authentication.
Clone the repo then install dependencies :
npm install
Create .env file :
cp .env.example .env
Run the following command to run startup migrations.
adonis migration:run
Run the following command to start the HTTP server (dev mode).
npm run dev
Register
POST /api/v1/auth/register
{email: 'youremail@gmail.com', password: 'yourpasswod'}
Sign-In
POST /api/v1/auth/sign-in
{email: 'youremail@gmail.com', password: 'yourpasswod'}
Refresh the token
POST /api/v1/auth/token/refresh
{refresh_token:'REFRESH_TOKEN'}
Get the current user
GET /api/v1/user/me
Authorization : Bearer YOUR_TOKEN
Logout
POST /api/v1/auth/logout
{refresh_token:'REFRESH_TOKEN'}