diff --git a/server/src/V2/endpoints/jsonEndpoints.ts b/server/src/V2/endpoints/jsonEndpoints.ts index d67eb78d1..433eb8c9e 100644 --- a/server/src/V2/endpoints/jsonEndpoints.ts +++ b/server/src/V2/endpoints/jsonEndpoints.ts @@ -28,19 +28,25 @@ const endpointToField: Record = { "variants": "variants", } -// server -// .get('/cache/performance', (req, res) => { -// res.json(apicache.getPerformance()) -// }) - -// // add route to display cache index -// .get('/cache/index', (req, res) => { -// res.json(apicache.getIndex()) -// }) - server + // Midleware that handle caching .use(apicache.middleware('1 day', (req: Request) => req.method === 'GET', {})) + // .get('/cache/performance', (req, res) => { + // res.json(apicache.getPerformance()) + // }) + + // // add route to display cache index + // .get('/cache/index', (req, res) => { + // res.json(apicache.getIndex()) + // }) + + // Midleware that handle url transformation + .use((req, res, next) => { + // this is ugly BUT it fix the problem with + not becoming spaces + req.url = req.url.replace(/\+/g, ' ') + next() + }) /** diff --git a/server/tsconfig.json b/server/tsconfig.json index d0b5512b4..a3165dfaa 100644 --- a/server/tsconfig.json +++ b/server/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "./node_modules/@dzeio/config/tsconfig.base", + "extends": "./node_modules/@dzeio/config/tsconfig.base.json", "compilerOptions": { "outDir": "dist" },