This template demonstrates how to create a subproject that works with the parent project routing architecture.
This subproject is designed to be accessed through a parent project via path-based routing. It includes:
config
object in http.tsx
to match your project's name and path
name
field to your subproject's namebasePath
field to match the path you'll use in the parent project/my-app
, change basePath
to /my-app
proxies.tsx
file (see integration section below)When remixing this template, you'll need to update:
config
object at the top of the fileAfter deploying your subproject, you'll need to find its endpoint URL to use in the parent project:
https://username--endpoint-id.web.val.run
proxies.tsx
fileTo connect this subproject with a parent project:
proxyRoutes
array in the parent project's proxies.tsx
:{
pattern: '/your-subproject-path', // Must match basePath in your config
target: 'https://your-username--endpoint-id.web.val.run', // Your subproject endpoint
name: 'Your Subproject Name' // Display name
}
This template automatically handles paths whether accessed directly or through the parent project:
parentdomain.com/subproject/about
subproject-endpoint.web.val.run/about
Both scenarios are properly handled by the path processing logic in the request handler.