merciof / trainee-pitang-backend

This project is a REST API for appointments CRUD and management.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

trainee-pitang-backend

💡 Introduction

This project is a REST API for appointments CRUD and management.

🏠 Getting started

  1. Clone this repo.
  2. Install the dependencies using your favorite package manager ( yarn install or npm install ).
  3. Important: Rename the file config/config.example.js to config/config.js and add a mongodb database URI.
  4. Run the app. It will serve by default on port 8080.

🎉 Technologies

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.

🎫 Endpoints

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"}

MIT License © Mércio Filho

About

This project is a REST API for appointments CRUD and management.

License:MIT License


Languages

Language:JavaScript 100.0%