add getUserID and tests

This commit is contained in:
Michael C
2021-06-25 03:33:41 -04:00
parent e7fed0f3cf
commit d4695f0192
3 changed files with 142 additions and 0 deletions

View File

@@ -32,6 +32,7 @@ import {endpoint as getSegmentInfo} from './routes/getSegmentInfo';
import {postClearCache} from './routes/postClearCache';
import { addUnlistedVideo } from './routes/addUnlistedVideo';
import {postPurgeAllSegments} from './routes/postPurgeAllSegments';
import {getUserID} from './routes/getUserID';
export function createServer(callback: () => void) {
// Create a service (the app object is just a callback).
@@ -146,6 +147,9 @@ function setupRoutes(app: Express) {
app.post('/api/purgeAllSegments', postPurgeAllSegments);
app.post('/api/unlistedVideo', addUnlistedVideo);
// get userID from username
app.get('/api/userID', getUserID);
if (config.postgres) {
app.get('/database', (req, res) => dumpDatabase(req, res, true));