Created the GET /speedtests/statistics route

This commit is contained in:
Mathias Wagner
2023-02-22 19:20:35 +01:00
parent ed3c38ca5e
commit 1fbe394eb9

View File

@@ -15,6 +15,10 @@ app.get("/averages", password(true), async (req, res) => {
res.json(await tests.listAverage(req.query.days || 7));
});
app.get("/statistics", password(true), async (req, res) => {
res.json(await tests.listStatistics(req.query.days || 1));
});
// Runs a speedtest
app.post("/run", password(false), async (req, res) => {
if (pauseController.currentState) return res.status(410).json({message: "The speedtests are currently paused"});