Skip to content

Latest commit

 

History

History
66 lines (48 loc) · 1.2 KB

README.md

File metadata and controls

66 lines (48 loc) · 1.2 KB

Hosts Exercise

  • Rest Api with Node, Express and MySql
  • React on the frontend
  • Docker to generate the containers

Requirements

Usage

cd backend/
yarn
cd ../frontend/
yarn
cd ..
docker-compose build
docker-compose up (or with -d)
(wait for it to load everything)
open http://localhost:5000

Tests

  • On the backend folder, there is a test for the hosts
cd backend/
npm test

Api

Endpoints

Hosts resources

  • GET /hosts

  • POST /hosts

  • GET/hosts/:id

  • DELETE/hosts/:id

  • PUT/hosts/:id

  • GET/hosts/dashboard

  • GET/hosts/:id/properties

  • POST/hosts/:id/properties

  • GET/hosts/:id/properties/:pid

  • DELETE/hosts/:id/properties/:pid

  • PUT/hosts/:id/properties/:pid

  • GET/hosts/:id/properties/:pid/versions

Note

  • When adding a property, the field Airbnb Id needs to be from a real link
  • A Rule was added that fetches for the link and decides what to do, based on the status code
  • After some requests, the app can be blocked from making requests