dev #160

Merged
sora merged 97 commits from dev into master 2025-03-02 01:09:30 +01:00
Showing only changes of commit 1e10109bbe - Show all commits

View File

@ -1,37 +1,23 @@
const axios = require("axios");
module.exports = (fastify, opts, done) => {
fastify.get("/flight/:id", async (req, reply) => {
const ENDPOINT = "https://www.flightradar24.com/v1/search/web/find";
const FORMAT = "-";
if (req.params.id) {
axios
.get(ENDPOINT, {
params: {
format: FORMAT,
query: req.params.id,
limit: 16,
type: "schedule",
},
})
.then((res) => reply.send(res.data));
const url = new URL("https://www.flightradar24.com/v1/search/web/find");
url.searchParams.append('format', '-')
url.searchParams.append('query', req.params.id)
url.searchParams.append('limit', 16)
url.searchParams.append('type', 'schedule')
fetch(url).then((res) => reply.send(res.data));
} else {
return reply.send([]);
}
return reply;
});
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));
const url = new URL("https://nominatim.openstreetmap.org/");
url.searchParams.append('format', 'jsonv2')
url.searchParams.append('q', req.params.id)
fetch(url).then((res) => reply.send(res.data));
} else {
return reply.send([]);
}