Merge branch 'master' of https://github.com/ajayyy/SponsorBlockServer into searchSegments

This commit is contained in:
Michael C
2021-09-01 23:26:55 -04:00
7 changed files with 59 additions and 2 deletions

View File

@@ -36,6 +36,7 @@ import {getUserID} from "./routes/getUserID";
import {getLockCategories} from "./routes/getLockCategories";
import {getLockCategoriesByHash} from "./routes/getLockCategoriesByHash";
import {endpoint as getSearchSegments } from "./routes/getSearchSegments";
import {getStatus } from "./routes/getStatus";
import ExpressPromiseRouter from "express-promise-router";
import { Server } from "http";
@@ -168,6 +169,9 @@ function setupRoutes(router: Router) {
// get all segments that match a search
router.get("/api/searchSegments", getSearchSegments);
// get status
router.get("/api/status", getStatus);
if (config.postgres) {
router.get("/database", (req, res) => dumpDatabase(req, res, true));
router.get("/database.json", (req, res) => dumpDatabase(req, res, false));