geolocation api rate-limit: add per-provider prefix to cached response, refactor geocoding provider code
This commit is contained in:
18
server/services/geocoding/photon.js
Normal file
18
server/services/geocoding/photon.js
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
module.exports = {
|
||||
commonName: 'Photon',
|
||||
DEFAULT_ENDPOINT: 'https://photon.komoot.io/api/',
|
||||
endpoint: (req, res) => {
|
||||
return res.locals.settings.geocoding_provider || this.DEFAULT_ENDPOINT
|
||||
},
|
||||
|
||||
getParams (req, res) {
|
||||
const details = req.params.place_details
|
||||
|
||||
return {
|
||||
q: details,
|
||||
limit: 3,
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user