Exploring the client and server environments
In this section, you will learn about the two environments of every Remix application: the client and the server. First, we will learn more about how code is executed during runtime. Next, you will learn where to write your client and server code and how to help Remix’s compiler recognize what belongs in the client bundle and what belongs in the server bundle.
The two bundles of your Remix application
The Remix App Server does not expose its server setup, but most other templates do. In this section, we will use the Express.js template to review how Remix interacts with the web server.
Follow these steps to bootstrap an Express.js Remix app:
- Run the following
create-remix
command in a terminal:npx create-remix@2 --template remix-run/remix/templates/express
This time, we don’t use the basic template but Remix’s Express.js template.
Note that the
--template
flag points to a folder on GitHub.com, using the...