Add json page for database export

This commit is contained in:
Ajay Ramachandran
2021-03-20 01:13:16 -04:00
parent 02e628f533
commit 8423165df4
2 changed files with 19 additions and 6 deletions

View File

@@ -129,7 +129,8 @@ function setupRoutes(app: Express) {
app.post('/api/segmentShift', postSegmentShift);
if (config.postgres) {
app.get('/database', dumpDatabase);
app.get('/database', (req, res) => dumpDatabase(req, res, true));
app.get('/database.json', (req, res) => dumpDatabase(req, res, false));
} else {
app.get('/database.db', function (req: Request, res: Response) {
res.sendFile("./databases/sponsorTimes.db", {root: "./"});