Files
docs/examples/fp/server.js
T
2025-10-01 12:03:43 +08:00

28 lines
637 B
JavaScript

import { createRequestListener } from '@remix-run/node-fetch-server';
import express from 'express';
import build from './dist/rsc/index.js';
const app = express();
app.use(
'/assets',
express.static('dist/client/assets', {
immutable: true,
maxAge: '1y',
}),
);
app.use(express.static('dist/client'));
app.get('/.well-known/appspecific/com.chrome.devtools.json', (_, res) => {
res.status(404);
res.end();
});
app.use(createRequestListener(build));
const PORT = Number.parseInt(process.env.PORT || '3000');
app.listen(PORT, () => {
console.log(`Server listening on port ${PORT} (http://localhost:${PORT})`);
});