mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-06 11:36:58 +03:00
Setup csv exports and html status page
This commit is contained in:
11
src/app.ts
11
src/app.ts
@@ -26,6 +26,7 @@ import {userCounter} from './middleware/userCounter';
|
||||
import {loggerMiddleware} from './middleware/logger';
|
||||
import {corsMiddleware} from './middleware/cors';
|
||||
import {rateLimitMiddleware} from './middleware/requestRateLimit';
|
||||
import dumpDatabase from './routes/dumpDatabase';
|
||||
|
||||
|
||||
export function createServer(callback: () => void) {
|
||||
@@ -127,7 +128,11 @@ function setupRoutes(app: Express) {
|
||||
//get if user is a vip
|
||||
app.post('/api/segmentShift', postSegmentShift);
|
||||
|
||||
app.get('/database.db', function (req: Request, res: Response) {
|
||||
res.sendFile("./databases/sponsorTimes.db", {root: "./"});
|
||||
});
|
||||
if (config.postgres) {
|
||||
app.get('/database', dumpDatabase);
|
||||
} else {
|
||||
app.get('/database.db', function (req: Request, res: Response) {
|
||||
res.sendFile("./databases/sponsorTimes.db", {root: "./"});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user