Skip to content

Commit

Permalink
fix: revert
Browse files Browse the repository at this point in the history
  • Loading branch information
JimmyLv committed Mar 2, 2023
1 parent 56ebe64 commit 31dff80
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export async function middleware(req: NextRequest, context: NextFetchEvent) {

const { bvId, apiKey } = await req.json();
const result = await redis.get<string>(bvId);
if (!result) {
if (result) {
console.log("hit cache for ", bvId);
return NextResponse.json(result);
}
Expand Down Expand Up @@ -59,8 +59,4 @@ export async function middleware(req: NextRequest, context: NextFetchEvent) {

export const config = {
matcher: "/api/summarize",
unstable_allowDynamic: [
"node_modules/undici/lib/core/util.js", // allows a single file
// '/node_modules/function-bind/**', // use a glob to allow anything in the function-bind 3rd party module
],
};

1 comment on commit 31dff80

@vercel
Copy link

@vercel vercel bot commented on 31dff80 Mar 2, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.