Integrated providers into the speedtests.js route

This commit is contained in:
Mathias Wagner
2024-05-19 15:31:05 +02:00
parent 6643234676
commit ae7099f6e0

View File

@@ -22,8 +22,7 @@ app.get("/statistics", password(true), async (req, res) => {
app.post("/run", password(false), async (req, res) => {
if (pauseController.currentState) return res.status(410).json({message: "The speedtests are currently paused"});
if (await config.getValue("acceptOoklaLicense") === "false")
return res.status(410).json({message: "You need to accept the ookla license first"});
if (await config.getValue("provider") === "none") return res.status(410).json({message: "No provider selected"});
let speedtest = await testTask.create("custom");
if (speedtest !== undefined) return res.status(409).json({message: "An speedtest is already running"});
res.json({message: "Speedtest successfully created"});