mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
23 lines
No EOL
463 B
JavaScript
23 lines
No EOL
463 B
JavaScript
const cache = require('memory-cache')
|
|
const providerCache = new cache.Cache()
|
|
|
|
const photon = {
|
|
commonName: 'Photon',
|
|
DEFAULT_ENDPOINT: 'https://photon.komoot.io/api/',
|
|
endpoint: (req, res) => {
|
|
return res.locals.settings.geocoding_provider || photon.DEFAULT_ENDPOINT
|
|
},
|
|
cache: providerCache,
|
|
|
|
getParams (req, res) {
|
|
const details = req.params.place_details
|
|
|
|
return {
|
|
q: details,
|
|
limit: 3,
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
module.exports = photon |