diff --git a/.env.example b/.env.example index 1e759d8..7e267aa 100644 --- a/.env.example +++ b/.env.example @@ -2,7 +2,7 @@ PORT=5460 SUPABASE_URL= SUPABASE_KEY= IPFS_GATEWAY=https://ipfs.desci.com/ipfs -# If truthy, the `/*` route will use the legacy handler +# If set to 1, the `/*` route will use the legacy handler FALLBACK_RESOLVER=0 # Local diff --git a/src/index.ts b/src/index.ts index 6a709f3..bd447c3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -98,7 +98,8 @@ const legacyResolve = async (req: Request, res: Response) => { } }; -if (process.env.FALLBACK_RESOLVER) { +if (process.env.FALLBACK_RESOLVER === "1") { + logger.warn({ FALLBACK_RESOLVER: process.env.FALLBACK_RESOLVER }, "Fallback configured, using legacy resolution"); app.get("/*", legacyResolve); } else { app.get("/*", resolveGenericHandler); diff --git a/vitest.config.ts b/vitest.config.ts index 4575457..bd31c4b 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -1,11 +1,10 @@ -import { defineConfig } from 'vitest/config' +import { defineConfig } from "vitest/config"; export default defineConfig({ - test: { - include: [ "test/**/*" ], - watch: false, - // the test files invoke the app on the same port - fileParallelism: false, - }, - + test: { + include: ["test/**/*"], + watch: false, + // the test files invoke the app on the same port + fileParallelism: false, + }, });