Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions server/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import crypto from 'crypto'
import { createRequestHandler } from '@react-router/express'
import { ip as ipAddress } from 'address'
import chalk from 'chalk'
import closeWithGrace from 'close-with-grace'
Expand Down Expand Up @@ -217,18 +216,8 @@ if (IS_DEV) {
// Everything else (like favicon.ico) is cached for an hour. You may want to be
// more aggressive with this caching.
app.use(express.static('build/client', { maxAge: '1h' }))
const build = await import(BUILD_PATH)
app.all(
/.*/,
createRequestHandler({
mode: MODE,
build,
getLoadContext: (_req, res) => ({
cspNonce: res.locals.cspNonce,
serverBuild: build,
}),
}),
)
const buildModule = await import(BUILD_PATH)
app.use(buildModule.app)
}

const desiredPort = Number(process.env.PORT || 3000)
Expand Down
Loading