Move Pazisme Mod page to a standalone HTML #86

Merged
Thilawyn merged 71 commits from next into master 2026-05-19 19:20:39 +02:00
Showing only changes of commit 3a9cd2bed9 - Show all commits
+2 -2
View File
@@ -23,7 +23,7 @@ const makeProductionWebappRoute = Effect.fnUntraced(function*(route: HttpRouter.
return HttpRouter.all(route, Effect.gen(function*() { return HttpRouter.all(route, Effect.gen(function*() {
const req = yield* HttpServerRequest.HttpServerRequest 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( const exists = yield* fs.stat(source).pipe(
Effect.andThen(stat => stat.type === "File"), Effect.andThen(stat => stat.type === "File"),
Effect.catchAll(() => Effect.succeed(false)), Effect.catchAll(() => Effect.succeed(false)),
@@ -32,7 +32,7 @@ const makeProductionWebappRoute = Effect.fnUntraced(function*(route: HttpRouter.
return yield* HttpServerResponse.setHeader( return yield* HttpServerResponse.setHeader(
yield* HttpServerResponse.file(exists ? source : path.join(dist, "index.html")), yield* HttpServerResponse.file(exists ? source : path.join(dist, "index.html")),
"Cache-Control", "Cache-Control",
`public, max-age=${Duration.toSeconds("365 days")}, immutable` `public, max-age=${Duration.toSeconds("365 days")}, immutable`,
) )
})) }))
}) })