https://github.com/juhsinto/aupubtoiletserver
LooCation - Public Toilet Finder - Back-End
https://github.com/juhsinto/aupubtoiletserver
geojson golang nodejs rest-api
Last synced: 4 months ago
JSON representation
LooCation - Public Toilet Finder - Back-End
- Host: GitHub
- URL: https://github.com/juhsinto/aupubtoiletserver
- Owner: juhsinto
- Created: 2019-10-20T01:40:19.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2024-07-19T04:26:16.000Z (almost 2 years ago)
- Last Synced: 2025-12-18T11:20:17.221Z (7 months ago)
- Topics: geojson, golang, nodejs, rest-api
- Language: JavaScript
- Homepage: https://tiny-ruby-snapper-tie.cyclic.app/
- Size: 76.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# National (AU) Public Toilet API
REST API built with Express, Mongo (hosted externally - on MongoDB), and node
Data from https://data.gov.au/dataset/ds-dga-553b3049-2b8b-46a2-95e6-640d7986a8c1/details
## EndPoints
- GET: /api
- GET: /api/toilets
- POST:/api/toilets with body {lat: , long: }
- POST:/api/toilets-dist with body {lat: , long: , dist: }
## The POST endpoint, finds the toilets 500 meters closest to the given GPS location
`db.toilets.find( { loc: { $near : { $geometry: { type: "Point", coordinates: [144.957442, -37.803926] }, $minDistance: 0, $maxDistance: 500 } } } )`
This server uses ports 8080 and 8443
# TODO
- create tests (assertions) - https://stackoverflow.com/questions/6158933/how-is-an-http-post-request-made-in-node-js