server.mjs 569 B

1234567891011121314151617181920
  1. import { createRequestHandler } from "@remix-run/express";
  2. import { broadcastDevReady } from "@remix-run/node";
  3. import express from "express";
  4. // notice that the result of `remix build` is "just a module"
  5. import * as build from "./build/index.js";
  6. const app = express();
  7. app.use(express.static("public"));
  8. // and your app is "just a request handler"
  9. app.all("*", createRequestHandler({ build }));
  10. app.listen(3100, () => {
  11. if (process.env.NODE_ENV === "development") {
  12. broadcastDevReady(build);
  13. }
  14. console.log("App listening on http://localhost:3100");
  15. });