endpoint + tests for getVideoLabels

This commit is contained in:
Michael C
2022-03-31 03:47:06 -04:00
parent fe0afd58bc
commit e6bf20937d
5 changed files with 390 additions and 1 deletions

View File

@@ -48,6 +48,8 @@ import { getRating } from "./routes/ratings/getRating";
import { postClearCache as ratingPostClearCache } from "./routes/ratings/postClearCache";
import { getTopCategoryUsers } from "./routes/getTopCategoryUsers";
import { addUserAsTempVIP } from "./routes/addUserAsTempVIP";
import { endpoint as getVideoLabels } from "./routes/getVideoLabel";
import { getVideoLabelsByHash } from "./routes/getVideoLabelByHash";
export function createServer(callback: () => void): Server {
// Create a service (the app object is just a callback).
@@ -202,6 +204,10 @@ function setupRoutes(router: Router) {
router.post("/api/ratings/rate", postRateEndpoints);
router.post("/api/ratings/clearCache", ratingPostClearCache);
// labels
router.get("/api/videoLabels", getVideoLabels);
router.get("/api/videoLabels/:prefix", getVideoLabelsByHash);
if (config.postgres) {
router.get("/database", (req, res) => dumpDatabase(req, res, true));
router.get("/database.json", (req, res) => dumpDatabase(req, res, false));