Skip to content

Latest commit

 

History

History
32 lines (24 loc) · 1.43 KB

File metadata and controls

32 lines (24 loc) · 1.43 KB

API Server for Ukraine4You

State: in development


Basic routes

  1. GET /api/regions : get all regions

  2. GET /api/regions/districts : get all districts from all regions

  3. GET /api/regions/districts/places : get all places from all districts from all regions

  4. GET /api/regions/districts/{ districtId }

  5. GET /api/regions/districts/places/{ placeId }

  6. GET /api/regions/{ regionId }/ : get region info by ID

  7. GET /api/regions/{ regionId }/districts : get all districts from selected region

  8. GET /api/regions/{ regionId }/districts/{ districtId } : get district by ID from selected region

  9. GET /api/regions/{ regionId }/districts/{ districtId }/places : get all available places from selected region and district

  10. GET /api/regions/{ regionId }/districts/{ districtId }/places/{ placeId } : get place by ID from selected region and district

  11. GET /api/regions/{ regionId }/places : get all places by region id


Guide: init server

  1. Create .env in root directory
  2. Set environment constant for mongoDB mongoUri=mongodb+srv://<username>:<password>@cluster0-q5xnz.mongodb.net/Ukraine4You?retryWrites=true&w=majority
  3. Set environment constant for Postres DB sqlDataBase=<Name of DB>, sqlPassword=<Your DB password>, sqlPort=<Port>, host=<host>
  4. Replace <username> and <password> with your credentials
  5. Install dependencies with npm i command
  6. Run server with npm start
  7. Open in browser http://localhost:8080