Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/lib/server/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const tsRestHandleErrors = async (
error: unknown,
req: TsRestRequest
): Promise<TsRestResponse> => {
const [_err, body] = req.bodyUsed ? [null, undefined] : await tryCatch(await req.json())
const [_err, body] = req.bodyUsed ? [null, undefined] : await tryCatch(req.json())
if (error instanceof RequestValidationError) {
logger.error({ err: error.body, input: body })
return TsRestResponse.fromJson(
Expand Down
17 changes: 17 additions & 0 deletions infra/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,23 @@
}
}

# cannot be handled by simple redirects at eg cloudflare level
# would strip credentials
app.pubpub.org {
encode gzip

handle /api/* {
reverse_proxy platform:3000 {
# present the canonical hostname to the app
header_up Host {$PUBSTAR_HOSTNAME}
}
}

handle {
redir https://{$PUBSTAR_HOSTNAME}{uri} 301
}
}

:80 {
respond "OK" 200
}
Loading