Server
The server is the main entry point for the FrontCommerce Remix application. It is responsible for handling requests and responses, and for rendering the application.
startExpressServer
The startExpressServer
function is the main entry point for the server. It is
responsible for starting the Express server and listening for requests.
import { startExpressServer } from "@front-commerce/remix/server/express";
startExpressServer();
Using express middlewares
Since the server is an Express server, you can use any express middleware.
You can register them by passing an array of middleware functions to the
startExpressServer
function.
import { startExpressServer } from "@front-commerce/remix/server/express";
import myExpressMiddleware from "my-express-middleware";
startExpressServer([myExpressMiddleware]);
A good example of what you may use express middlewares for is to add custom redirections. You can check out the create custom redirections guide for more information.