add getSearchSegments endpoint

This commit is contained in:
Michael C
2021-08-27 21:46:39 -04:00
parent d99ffdabd7
commit 840ccb517e
4 changed files with 197 additions and 0 deletions

View File

@@ -35,6 +35,7 @@ import {postPurgeAllSegments} from "./routes/postPurgeAllSegments";
import {getUserID} from "./routes/getUserID";
import {getLockCategories} from "./routes/getLockCategories";
import {getLockCategoriesByHash} from "./routes/getLockCategoriesByHash";
import {endpoint as getSearchSegments } from "./routes/getSearchSegments";
import ExpressPromiseRouter from "express-promise-router";
import { Server } from "http";
@@ -164,6 +165,9 @@ function setupRoutes(router: Router) {
// get privacy protecting lock categories functions
router.get("/api/lockCategories/:prefix", getLockCategoriesByHash);
// get all segments that match a search
router.get("/api/searchSegments", getSearchSegments);
if (config.postgres) {
router.get("/database", (req, res) => dumpDatabase(req, res, true));
router.get("/database.json", (req, res) => dumpDatabase(req, res, false));