A TurboStack production application is separated in a domain that hosts the landing page for marketing purposes and an app subdomain that hosts the application itself.

It’s a common practice in the industry to use an app subdomain to separate your application from your landing page. This practice has been adopted for these reasons:

  • Organization: A subdomain allows for better organization of content. The main domain can focus on marketing and support, while the app subdomain is dedicated to the application itself. This separation make the navigation and user experience smoother.
  • Security: Using an app subdomain can help implement specific security measure tailored to the application. For example, common cases do not have to handle any public page different than /sign-in.
  • Tracking Segmentation: An app subdomain simplify tracking. You can segment traffic and user behavior more easily between the applicaiton and the marketing site, helping you find specific insights.

With all reasons explained, we need to setup our /etc/hosts file to point the subdomain app.localhost to the address 127.0.0.1.

  1. In your terminal, open the /etc/hosts file in your favorite editor
sudo nano /etc/hosts
  1. Add the following line at the end of the file:
127.0.0.1 app.localhost

With all things done, you can open http://app.localhost:3000 and you will see a page like this: