Added manticore sync API.

This commit is contained in:
2026-06-08 05:50:29 +02:00
parent 1bc7dd3a43
commit 96b1a99e04
6 changed files with 70 additions and 9 deletions

View File

@@ -16,6 +16,7 @@ import initRestrictionHandler from './restrictions.js';
import { scenesRouter } from './scenes.js';
import { actorsRouter } from './actors.js';
import { syncRouter } from './sync.js';
import { fetchMoviesApi } from './movies.js';
import { fetchEntitiesApi } from './entities.js';
@@ -122,11 +123,7 @@ export default async function initServer() {
router.use('/api/*', async (req, _res, next) => {
if (req.headers['api-user']) {
await verifyKey(req.headers['api-user'], req.headers['api-key'], req);
req.user = { // eslint-disable-line no-param-reassign
id: Number(req.headers['api-user']),
};
req.user = await verifyKey(req.headers['api-user'], req.headers['api-key'], req);
}
next();
@@ -150,6 +147,7 @@ export default async function initServer() {
router.use(alertsRouter);
router.use(scenesRouter);
router.use(actorsRouter);
router.use(syncRouter);
// MOVIES
router.get('/api/movies', fetchMoviesApi);