This project is dependant on nodejs
, npm
and postgreSQL
. Please install them before using this API.
- Download or clone the project.
- Now go to projects root folder, i.e.
cd ~/tif-api
- Run the command below to setup environment and install project dependenies.
npm install
- Add your postgres local password to the client object in connection.js. We use all the other localhost defaults.
- Run below command to start the server
npx nodemon app.js
- To setup a sample database, run the init.sql file in your local postgres shell with
\i path_to_init.sql
- Get all employees by making a GET request to /employee.
- Get an employee by id making a GET request to /employee/:id.
- Add a new employee by making a POST request to /employee/:id with the following json format in the body.
{ "first_name": "emp3fname", "last_name": "emp3lname", "mobile_no": "1234567890", "email_id": "emp3@gmail.com" }
- Get attendance of all employees by making a GET request to /attendance.
- Get attendance of an employee by id by making a GET request to /attendance/:id.
- Add a new checkin entry for an employee by making a POST request to /attendance/:id.
- Add a new checkout entry of an employee by making a PATCH request to /attendance/:id.
- Delete an employee with id by making a DELETE request to /employee/:id.