mirror of
https://github.com/gnmyt/myspeed.git
synced 2026-02-09 23:18:37 -06:00
Updated the export.js route
This commit is contained in:
@@ -4,12 +4,12 @@ const password = require('../middlewares/password');
|
||||
|
||||
app.get("/json", password(false), async (req, res) => {
|
||||
res.set({"Content-Disposition": "attachment; filename=\"speedtests.json\""});
|
||||
res.send(JSON.stringify(await tests.list(), null, 4));
|
||||
res.send(JSON.stringify(await tests.listTests(), null, 4));
|
||||
});
|
||||
|
||||
app.get("/csv", password(false), async (req, res) => {
|
||||
res.set({"Content-Disposition": "attachment; filename=\"speedtests.csv\""});
|
||||
let list = await tests.list();
|
||||
let list = await tests.listTests();
|
||||
|
||||
if (list.length === 0) return res.send("");
|
||||
let fields = Object.keys(list[0]);
|
||||
|
||||
Reference in New Issue
Block a user