Fix
All checks were successful
Lint / lint (push) Successful in 13s

This commit is contained in:
Julien Valverdé
2024-09-05 00:35:59 +02:00
parent 4f16a08b7f
commit 3879efa44e
3 changed files with 35 additions and 14 deletions

View File

@@ -10,9 +10,11 @@ const importExpress = Effect.tryPromise({
catch: cause => new Error("Could not import 'express'. Make sure it is installed.", { cause }),
})
export const ExpressAppLive = (config: {
readonly trustProxy?: Config.Config<boolean>
}) => Layer.effect(ExpressApp, Effect.gen(function*() {
export const ExpressAppLive = (
config: {
readonly trustProxy?: Config.Config<boolean>
} = {}
) => Layer.effect(ExpressApp, Effect.gen(function*() {
const app = (yield* importExpress).default()
app.set("trust proxy", yield* config.trustProxy || Config.succeed(false))
return app