Commit e135421e authored by Elias Ojala's avatar Elias Ojala

Speed up /explore/speedtest-servers/map

parent 83d1ff2c
......@@ -141,7 +141,12 @@ router.get("/speedtest-servers/:isMap?", (req: Request, res: Response, next: Nex
break;
}
if(format && isMapOrNot) {
if(format === "map" && isMapOrNot) {
res.render("explore/speedtest-servers/map.twig", {
title: `Browse Speedtest.net servers (map)`,
canonical_url: `/explore/speedtest-servers/map`,
});
} else if(format && isMapOrNot) {
Axios.get(`https://www.speedtest.net/speedtest-servers.php`)
.then(x => x.data)
.then(rawXmlData => {
......@@ -166,11 +171,7 @@ router.get("/speedtest-servers/:isMap?", (req: Request, res: Response, next: Nex
} else if(format === DataReturnFormat.Jsonp) {
res.jsonp(servers);
} else if(format === "map") {
res.render("explore/speedtest-servers/map.twig", {
title: `Browse Speedtest.net servers (map)`,
canonical_url: `/explore/speedtest-servers/map`,
servers,
});
next();
} else {
res.render("explore/speedtest-servers/table.twig", {
title: `Browse Speedtest.net servers (table)`,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment