Remix App Server

While you can bring your own server, Remix ships with a built-in, production ready application server.

remix-serve <server-build-path>

Depending on process.env.NODE_ENV, the server will boot in development or production mode.

The server-build-path needs to point to the serverBuildDirectory defined in remix.config.js.

Because only the build artifacts (build/, public/build/) need to be deployed to production, the remix.config.js is not guaranteed to be available in production, so you need to tell Remix where your server build is with this option.

In development, remix-serve will ensure the latest code is run by purging the require cache for every request. This has some effects on your code you might need to be aware of:

In production this doesn't happen. The server boots up and that's the end of it.