This is an API server to be used with any app, written in express.js and using MariaDB as the database. It allows users to Create/Delete worker data, allows work orders to be created, fetched, and assigned to different workers.
- Make sure mariaDB is installed on the system
- Please see
utils/db.js
to change server connection credentials - Please create the database you are going to use
- See
utils/sqlUtils.js
for the mySQL statements to initialize the database
- run
npm i
to install dependencies - run
node sample_be
in the console
POST : https://aws.koumakan.work/sample_be/api/workers
Format:
{
"name": "Jacky LI",
"company_name" : "Koumakan.work",
"email": "[email protected]"
}
DELETE : https://aws.koumakan.work/sample_be/api/workers/:workerId
POST : https://aws.koumakan.work/sample_be/api/orders/add
Format:
{
"title":"yeet",
"description" : "some order",
"deadline" : "2019-07-11 16:46:06" // FORMAT IS IMPORTANT
}
GET : https://aws.koumakan.work/sample_be/api/orders/all
PUT : https://aws.koumakan.work/sample_be/api/orders/assign/:orderId/:workerId