NodeJS Tasks for Practice
Database Connection
- In db.js file
- const sequelize = new Sequelize("assignment", "root", "", { host: "localhost", dialect: "mysql", }); Replace root as username and next parameter as password
- Inside config/config.json in development add credentials
- Sample Database is added assignment.sql
Task 1:
- API is created to upload file and insert data into database
- Data is stored in schedule table
- POST http://localhost:3000/schedule
- Postman Collection is added Assignment.postman_collection.json
Task2:
-
Add Reimbursement
- POST http://localhost:3000/reimbursement/add
- Postman Collection is added for every type
- Sample Data stored in data/reimbursement folder
- Reimbursement Type is stored in reimbursement_types table
- Corresponding type data date wise is stored in reimbursements table
-
Get All Reimbursement
- GET http://localhost:3000/reimbursement
- Postman Collection is added
-
Get a specific Reimbursement
- POST http://localhost:3000/reimbursement
- Postman Collection is added
- typeId and date needs to be passed in body where typeId is from reimbursement_types table primary key
- { "typeId": 1, "date": "2020-01-01" }