This project is a REST API for appointments CRUD and management.
- Clone this repo.
- Install the dependencies using your favorite package manager ( yarn install or npm install ).
- Important: Rename the file config/config.example.js to config/config.js and add a mongodb database URI.
- Run the app. It will serve by default on port 8080.
This project uses the following technologies
- ⚡ NodeJS and Express -> For a minimalist web server.
- ⚡ Mongoose -> For document to object mapping.
- ⚡ Yup -> For request validation.
- ⚡ MomentJS -> For nice visualization of dates.
- ⚡ Supertest, Mocha and Chai -> For api endpoints tests.
CRUD methods:
HTTP Method | URL | Function |
---|---|---|
GET | api/appointment | index |
GET | api/appointment/id | read |
POST | api/appointment | create |
PUT | api/appointment/id | update |
DELETE | api/appointment/id | delete |
Management methods:
HTTP Method | URL | Function |
---|---|---|
POST | api/getAppointmentsByDay | getAppointmentsByDay |
POST | api/getAppointmentsByHour | getAppointmentsByHour |
POST | api/getAppointmentsByMonth | getAppointmentsByMonth |
Request body example:
{"name":"John Doe","birthDay":"2000-08-30T22:00:00.000Z","appointmentDate": "2022-03-02T02:00:00.000Z"}