[ENDPOINT] /api/v1/api-docs
[GET] http://localhost:5000/api/v1/api-docs
[ENDPOINT] /api/v1/cars
[GET] http://localhost:5000/api/v1/cars
{
"status": "OK",
"data": {
"cars": [
{
"id": 1,
"name": "Avanza",
"image": "avanza.jpg",
"price": 500000,
"size": "small",
"type": "Off Roader",
"createdAt": "2022-10-20T23:25:42.399Z",
"updatedAt": "2022-10-20T23:25:42.399Z"
},
...
]
},
"meta": {
"total": 16
}
}
[ENDPOINT] /api/v1/cars/{id}
[GET] http://localhost:5000/api/v1/cars/1
{
"status": "OK",
"data": {
"id": 1,
"name": "Avanza",
"image": "avanza.jpg",
"price": 500000,
"size": "small",
"type": "Off Roader",
"createdAt": "2022-10-20T23:25:43.356Z",
"updatedAt": "2022-10-20T23:25:43.356Z"
}
}
[ENDPOINT] /api/v1/cars
[POST] http://localhost:5000/api/v1/cars
{
"name": String,
"image": String,
"price": Integer,
"size": String,
"type": string
}
{
"status": "OK",
"data": {
"id": 31,
"name": "Avanza",
"image": "avanza.jpg",
"price": 500000,
"size": "small",
"type": "Off Roader",
"updatedAt": "2022-10-21T00:35:40.334Z",
"createdAt": "2022-10-21T00:35:40.334Z"
}
}
[ENDPOINT] /api/v1/cars/{id}
[PUT] http://localhost:5000/api/v1/cars/1
{
"name": String,
"image": String,
"price": Integer,
"size": String,
"type": String
}
{
"status": "OK",
"message": "Car Successfully Updated"
}
[ENDPOINT] /api/v1/cars/{id}
[DELETE] http://localhost:5000/api/v1/cars/1
{
"status": "OK",
"message": "Car Successfully Deleted"
}
email: superadmin@gmail.com password: super_admin
[ENDPOINT] /api/v1/register
[POST] http://localhost:5000/api/v1/register
{
"username": String,
"email": string,
"password": string,
"confPassword": string
}
{
"status": "OK",
"message": "Register User Successfully",
"data": {
"id": 1,
"username": "Pahrurozi",
"email": "pahrurozi17@gmail.com",
"password": "$2b$10$ulatiMgD1Bbni/GiTHxh2u7.mtmLBizoXnmn8euLIsu20oxKday0G",
"role": "Member",
"updatedAt": "2022-10-21T00:36:36.859Z",
"createdAt": "2022-10-21T00:36:36.859Z",
"refresh_token": null
}
}
[ENDPOINT] /api/v1/login
[POST] http://localhost:5000/api/v1/login
{
"email": string,
"password": string
}
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTUsInVzZXJuYW1lIjoiUGFocnVyb3ppIiwiZW1haWwiOiJwYWhydXJvemkxN0BnbWFpbC5jb20iLCJpYXQiOjE2NjYzMTI2MTAsImV4cCI6MTY2NjMxMjkxMH0.4hDh2A_kDls3RoisK9ZOfM7fhTznvUKrzYkxPG2ZecU"
}
[ENDPOINT] /api/v1/users
[GET] http://localhost:5000/api/v1/users
{
"status": "OK",
"data": {
"users": [
{
"id": 1,
"username": "Pahrurozi",
"email": "pahrurozi17@gmail.com",
"password": "$2b$10$qvuaEe9LZtpeqswfPbaQteaNBNmgzbFOertdreXgjBywXy7ijRysG",
"role": "Member",
"refresh_token": null,
"createdAt": "2022-10-20T23:49:09.169Z",
"updatedAt": "2022-10-20T23:49:09.169Z"
},
...
]
},
"meta": {
"total": 10
}
}
[ENDPOINT] /api/v1/cars/user
[GET] http://localhost:5000/api/v1/user
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NiwidXNlcm5hbWUiOiJBZG1pbiIsImVtYWlsIjoiaW5pYWRtaW4yQGdtYWlsLmNvbSIsImlhdCI6MTY2NjMxNDExMiwiZXhwIjoxNjY2MzE0NDEyfQ._-94LOVbHK-mmLgrtr-FTtSFLX3YfSsrRd8a9GzmUmo
{
"id": 6,
"username": "Admin",
"email": "iniadmin2@gmail.com",
"password": "$2b$10$TiUGekyjAZk3VM/hDazxEuEdII3Q3fVFeQmEe3GBDL.97B1TIWIKm",
"role": "Admin",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NiwidXNlcm5hbWUiOiJBZG1pbiIsImVtYWlsIjoiaW5pYWRtaW4yQGdtYWlsLmNvbSIsImlhdCI6MTY2NjMxNDExMiwiZXhwIjoxNjY2NDAwNTEyfQ.Ax-MbKHLBf5bJlSz439waUNnyBHYIRMnhPSUqkLJFwA",
"createdAt": "2022-10-19T22:07:43.439Z",
"updatedAt": "2022-10-21T01:01:52.564Z"
}
[ENDPOINT] /api/v1/admin
[POST] http://localhost:5000/api/v1/admin
{
"username": string,
"email": string,
"password": string,
"confPassword": string,
}
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NiwidXNlcm5hbWUiOiJBZG1pbiIsImVtYWlsIjoiaW5pYWRtaW4yQGdtYWlsLmNvbSIsImlhdCI6MTY2NjMxNDExMiwiZXhwIjoxNjY2MzE0NDEyfQ._-94LOVbHK-mmLgrtr-FTtSFLX3YfSsrRd8a9GzmUmo
{
"status": "OK",
"message": "Register User Successfully",
"data": {
"id": 18,
"username": "Admin",
"email": "iniadmin2@gmail.com",
"password": "$2b$10$p8M9dF/0UjoFZDrvVXoKZOJfFX0I6P9uuZh/zs9H/eWj5XLxqGOYm",
"role": "Admin",
"updatedAt": "2022-10-21T01:12:26.129Z",
"createdAt": "2022-10-21T01:12:26.129Z",
"refresh_token": null
}
}
npm install : Install all packages
npm run db:create : Used to create database
npm run db:migrate : Used to run database
npm run db:seed : Used to run seeders
npm run start : Used to run this app
Created by @pahrurozi