♻️ oo-connector: refactored router system to something more coherent (#525)

This commit is contained in:
Eric Doughty-Papassideris
2024-09-04 03:47:59 +02:00
parent afe6562804
commit 9bc9dcafee
10 changed files with 97 additions and 83 deletions
@@ -1,7 +1,6 @@
import logger from '@/lib/logger';
import { NextFunction, Request, Response } from 'express';
import * as Utils from '@/utils';
import { SERVER_ORIGIN, SERVER_PREFIX } from '@config';
import { makeURLTo } from '@/routes';
export default (error: Error & { status?: number }, req: Request, res: Response, next: NextFunction): void => {
try {
@@ -12,7 +11,7 @@ export default (error: Error & { status?: number }, req: Request, res: Response,
res.status(status);
res.render('error', {
server: Utils.joinURL([SERVER_ORIGIN, SERVER_PREFIX]),
server: makeURLTo.rootAbsolute(),
errorMessage: message,
});
} catch (error) {