Steps to Use
- Clone the Repository
- CD into the desired project folder
- Install all projects dependencies using
npm install
.. - Copy the content of
.env.example
and create a.env
and paste the content - Run
node ace migration:run
to create database tables on the database - Start backend server locally..
node ace serve --watch
. This should startup a local server @ `http://127.0.0.1:3333
make sure MYSQL server has started locally before running the above commands.
POST
http://127.0.0.1:3333/regsiter
PAYLOAD DATA
{
"username": "testuser",
"firstname": "testuser",
"lastname": "testuser",
"role_type": "user",
"email": "test@gmail.com",
"password": "password"
}
POST
http://127.0.0.1:3333/login
PAYLOAD DATA
{
"email": "test@gmail.com",
"password": "password"
}
POST
http://127.0.0.1:3333/logout
GET
http://127.0.0.1:3333/posts/:USERNAME
GET
http://127.0.0.1:3333/posts
GET
http://127.0.0.1:3333/posts/:ID
POST
http://127.0.0.1:3333/posts
PAYLOAD DATA
{
"title": "First blog post",
"content": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.."
}
PUT
http://127.0.0.1:3333/posts/:ID
PAYLOAD DATA
{
"title": "First blog post",
"content": "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.."
}
DELETE
http://127.0.0.1:3333/posts/:ID
If an error occur while migrating, cross check the
**.env**
file and make sure you passed the correct database informations Allow add bearer token for authentication after login