Skip to content

Commit

Permalink
Merge branch 'main' into adaptorBuildScript
Browse files Browse the repository at this point in the history
  • Loading branch information
sjjj986 authored Nov 21, 2023
2 parents d317c68 + af90eab commit 3ba85fe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/firebase-frameworks/src/next.js/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import { parse } from "url";
import next from "next";
import createNextServer from "next";
import LRU from "lru-cache";

import type { Request } from "firebase-functions/v2/https";
import type { Response } from "express";
import type { NextServer } from "next/dist/server/next.js";

const createServer = next.default;

const nextAppsLRU = new LRU<string, NextServer>({
// TODO tune this
max: 3,
Expand All @@ -27,7 +25,9 @@ export const handle = async (req: Request, res: Response) => {
// dynamic for middleware.
let nextApp = nextAppsLRU.get(key);
if (!nextApp) {
nextApp = createServer({
// @ts-expect-error - Next.js doesn't export the custom server function with proper types
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
nextApp = createNextServer({
dev: false,
dir: process.cwd(),
hostname: "0.0.0.0",
Expand Down

0 comments on commit 3ba85fe

Please sign in to comment.