Move Pazisme Mod page to a standalone HTML (#86)
Co-authored-by: Julien Valverdé <julien.valverde@mailo.com> Co-authored-by: Renovate Bot <renovate-bot@valverde.cloud> Reviewed-on: #86
This commit was merged in pull request #86.
This commit is contained in:
@@ -23,7 +23,7 @@ const makeProductionWebappRoute = Effect.fnUntraced(function*(route: HttpRouter.
|
||||
|
||||
return HttpRouter.all(route, Effect.gen(function*() {
|
||||
const req = yield* HttpServerRequest.HttpServerRequest
|
||||
const source = path.join(dist, req.url)
|
||||
const source = path.join(dist, decodeURI(new URL(req.url, "http://localhost").pathname))
|
||||
const exists = yield* fs.stat(source).pipe(
|
||||
Effect.andThen(stat => stat.type === "File"),
|
||||
Effect.catchAll(() => Effect.succeed(false)),
|
||||
@@ -32,7 +32,7 @@ const makeProductionWebappRoute = Effect.fnUntraced(function*(route: HttpRouter.
|
||||
return yield* HttpServerResponse.setHeader(
|
||||
yield* HttpServerResponse.file(exists ? source : path.join(dist, "index.html")),
|
||||
"Cache-Control",
|
||||
`public, max-age=${Duration.toSeconds("365 days")}, immutable`
|
||||
`public, max-age=${Duration.toSeconds("365 days")}, immutable`,
|
||||
)
|
||||
}))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user