mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-09 21:17:15 +03:00
add getSegmentInfo with tests
This commit is contained in:
@@ -28,7 +28,7 @@ import {corsMiddleware} from './middleware/cors';
|
||||
import {apiCspMiddleware} from './middleware/apiCsp';
|
||||
import {rateLimitMiddleware} from './middleware/requestRateLimit';
|
||||
import dumpDatabase, {redirectLink} from './routes/dumpDatabase';
|
||||
|
||||
import {endpoint as getSegmentInfo} from './routes/getSegmentInfo';
|
||||
|
||||
export function createServer(callback: () => void) {
|
||||
// Create a service (the app object is just a callback).
|
||||
@@ -133,6 +133,9 @@ function setupRoutes(app: Express) {
|
||||
//get if user is a vip
|
||||
app.post('/api/segmentShift', postSegmentShift);
|
||||
|
||||
//get segment info
|
||||
app.get('/api/segmentInfo', getSegmentInfo);
|
||||
|
||||
if (config.postgres) {
|
||||
app.get('/database', (req, res) => dumpDatabase(req, res, true));
|
||||
app.get('/database.json', (req, res) => dumpDatabase(req, res, false));
|
||||
|
||||
Reference in New Issue
Block a user