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:
parent
2b23503864
commit
4b340733d7
@ -28,19 +28,25 @@ const endpointToField: Record<string, keyof SDKCard> = {
|
|||||||
"variants": "variants",
|
"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
|
server
|
||||||
|
// Midleware that handle caching
|
||||||
.use(apicache.middleware('1 day', (req: Request) => req.method === 'GET', {}))
|
.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()
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "./node_modules/@dzeio/config/tsconfig.base",
|
"extends": "./node_modules/@dzeio/config/tsconfig.base.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"outDir": "dist"
|
"outDir": "dist"
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user