mirror of
https://github.com/gnmyt/myspeed.git
synced 2026-01-27 07:39:59 -06:00
Integrated providers into the speedtests.js route
This commit is contained in:
@@ -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"});
|
||||
|
||||
Reference in New Issue
Block a user