This commit is contained in:
@ -12,7 +12,21 @@ module.exports = (fastify, opts, done) => {
|
||||
limit:16,
|
||||
type: 'schedule'
|
||||
}
|
||||
}).then(res=>{reply.send(res.data)});
|
||||
}).then(res=>reply.send(res.data));
|
||||
}else{
|
||||
reply.send([]);
|
||||
}
|
||||
});
|
||||
fastify.get('/place/:id', async (req,reply) => {
|
||||
const ENDPOINT = 'https://nominatim.openstreetmap.org/';
|
||||
const FORMAT = 'jsonv2';
|
||||
if(req.params.id){
|
||||
axios.get(ENDPOINT,{
|
||||
params: {
|
||||
format: FORMAT,
|
||||
q: req.params.id,
|
||||
}
|
||||
}).then(res=>reply.send(res.data));
|
||||
}else{
|
||||
reply.send([]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user