Skip to content

Commit

Permalink
always use build.mode default
Browse files Browse the repository at this point in the history
  • Loading branch information
pcattori committed Feb 7, 2024
1 parent ffd8e7a commit bd5b3a9
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 23 deletions.
5 changes: 1 addition & 4 deletions docs/guides/manual-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,7 @@ app.all(
"*",
process.env.NODE_ENV === "development"
? createDevRequestHandler(initialBuild)
: createRequestHandler({
build: initialBuild,
mode: initialBuild.mode,
})
: createRequestHandler({ build: initialBuild })
);
```

Expand Down
8 changes: 1 addition & 7 deletions docs/other-api/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,7 @@ If not, you can follow these steps to integrate your project with `remix dev`:

// ... code for setting up your express app goes here ...

app.all(
"*",
createRequestHandler({
build,
mode: build.mode,
})
);
app.all("*", createRequestHandler({ build }));

const port = 3000;
app.listen(port, () => {
Expand Down
1 change: 0 additions & 1 deletion integration/helpers/deno-template/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import * as build from "@remix-run/dev/server-build";
const remixHandler = createRequestHandlerWithStaticFiles({
build,
getLoadContext: () => ({}),
mode: build.mode,
});

const port = Number(Deno.env.get("PORT")) || 8000;
Expand Down
1 change: 0 additions & 1 deletion packages/remix-dev/__tests__/fixtures/deno/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import * as build from "@remix-run/dev/server-build";
const remixHandler = createRequestHandlerWithStaticFiles({
build,
getLoadContext: () => ({}),
mode: build.mode,
});

const port = Number(Deno.env.get("PORT")) || 8000;
Expand Down
5 changes: 1 addition & 4 deletions templates/arc/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,4 @@ import sourceMapSupport from "source-map-support";
sourceMapSupport.install();
installGlobals();

export const handler = createRequestHandler({
build,
mode: build.mode,
});
export const handler = createRequestHandler({ build });
3 changes: 1 addition & 2 deletions templates/deno/server.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { serve } from "https://deno.land/[email protected]/http/server.ts";
import { createRequestHandlerWithStaticFiles } from "@remix-run/deno";
// Import path interpreted by the Remix compiler
import * as build from "@remix-run/dev/server-build";
import { serve } from "https://deno.land/[email protected]/http/server.ts";

const remixHandler = createRequestHandlerWithStaticFiles({
build,
getLoadContext: () => ({}),
mode: build.mode,
});

const port = Number(Deno.env.get("PORT")) || 8000;
Expand Down
5 changes: 1 addition & 4 deletions templates/express/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ const initialBuild = await reimportServer();
const remixHandler =
process.env.NODE_ENV === "development"
? await createDevRequestHandler(initialBuild)
: createRequestHandler({
build: initialBuild,
mode: initialBuild.mode,
});
: createRequestHandler({ build: initialBuild });

const app = express();

Expand Down

0 comments on commit bd5b3a9

Please sign in to comment.