1
0
mirror of https://github.com/tcgdex/cards-database.git synced 2025-04-23 19:32:11 +00:00

fix(server): Server not correctly handling +

Signed-off-by: Avior <github@avior.me>
This commit is contained in:
Florian Bouillon 2023-01-11 21:18:31 +01:00
parent 2b23503864
commit 4b340733d7
Signed by: Florian Bouillon
GPG Key ID: BEEAF3722D0EBF64
2 changed files with 17 additions and 11 deletions

View File

@ -28,19 +28,25 @@ const endpointToField: Record<string, keyof SDKCard> = {
"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()
})
/**

View File

@ -1,5 +1,5 @@
{
"extends": "./node_modules/@dzeio/config/tsconfig.base",
"extends": "./node_modules/@dzeio/config/tsconfig.base.json",
"compilerOptions": {
"outDir": "dist"
},