Skip to content

Commit

Permalink
Merge pull request #25 from desci-labs/m0ar/patch-fallback-check
Browse files Browse the repository at this point in the history
Patch fallback check
  • Loading branch information
m0ar authored Jun 28, 2024
2 parents 0fa7e35 + ee0a24d commit cc0b235
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
15 changes: 7 additions & 8 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -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,
},
});

0 comments on commit cc0b235

Please sign in to comment.