Routes
Routes define how users navigate your app. Each route maps a URL path (like /dashboard or /settings) to either a page or an event.
What are Routes?
Section titled “What are Routes?”A route is a connection between a URL and content:
URL Path → Target────────────────────────────────────/ → Dashboard Page (default)/reports → Reports Page/settings → Settings Event/products/:id → Product Detail PageWhen a user visits your app with a specific path, Flow-Like shows the corresponding page or triggers the associated event.
Why Routes?
Section titled “Why Routes?”Routes let you:
- Create multi-page apps - Build apps with distinct sections
- Deep link - Share direct links to specific content
- Control navigation - Define which pages are accessible
- Set a home page - Choose what users see first
Managing Routes
Section titled “Managing Routes”Access Route Settings
Section titled “Access Route Settings”- Open your app
- Click the gear icon (⚙️) to open settings
- Go to Pages & Routes
- Switch to the Routes tab
The Routes Panel
Section titled “The Routes Panel”┌─────────────────────────────────────────────────────────────────────┐│ Routes [+ Add Route] │├─────────────────────────────────────────────────────────────────────┤│ ││ ┌──────────────────────────────────────────────────────────────┐ ││ │ / [Default] │ ││ │ Page: Dashboard 🔘 [🗑] │ ││ └──────────────────────────────────────────────────────────────┘ ││ ││ ┌──────────────────────────────────────────────────────────────┐ ││ │ /reports │ ││ │ Page: Monthly Reports ○ [🗑] │ ││ └──────────────────────────────────────────────────────────────┘ ││ ││ ┌──────────────────────────────────────────────────────────────┐ ││ │ /api/webhook │ ││ │ Event: Webhook Handler ○ [🗑] │ ││ └──────────────────────────────────────────────────────────────┘ ││ │└─────────────────────────────────────────────────────────────────────┘Creating a Route
Section titled “Creating a Route”- Click Add Route
- Fill in the route details:
| Field | Description |
|---|---|
| Path | The URL path (e.g., /dashboard) |
| Target Type | Page or Event |
| Target | Which page or event to show |
| Default | Whether this is the home page |
- Click Create Route
Route Paths
Section titled “Route Paths”Paths start with / and can include:
| Pattern | Example | Matches |
|---|---|---|
| Static | /about | Exactly /about |
| Nested | /settings/profile | Exactly /settings/profile |
Route Targets
Section titled “Route Targets”A route can point to two types of targets:
Page Target
Section titled “Page Target”Shows a visual page when the route is accessed:
Route: /dashboardTarget Type: PageTarget: Dashboard Page
→ User visits /dashboard→ Dashboard Page is renderedEvent Target
Section titled “Event Target”Triggers a flow event when the route is accessed:
Route: /api/processTarget Type: EventTarget: Process Handler
→ User visits /api/process→ Process Handler event runs→ Response is returnedThis is useful for:
- API endpoints
- Webhooks
- Server-side processing
Default Route
Section titled “Default Route”The default route is shown when users visit your app without a specific path.
To set a default route:
- Find the route in the list
- Toggle the Default switch
- Only one route can be default at a time
Route Priority
Section titled “Route Priority”When multiple routes could match a path, Flow-Like uses priority:
- Exact matches first
- Then priority number (higher = checked first)
- Finally creation order
You can adjust priority by reordering routes in the settings.
Navigation Between Routes
Section titled “Navigation Between Routes”User Navigation
Section titled “User Navigation”Users navigate between routes using:
- Links - Clickable text or buttons
- Navigation menus - Built-in navigation components
- Direct URL - Typing or sharing links
Programmatic Navigation
Section titled “Programmatic Navigation”From your flows, you can:
- Redirect - Send users to a different route
- Navigate - Change the current route
- Open in new tab - Launch a route in a new window
Best Practices
Section titled “Best Practices”Path Naming
Section titled “Path Naming”| ✅ Good | ❌ Avoid |
|---|---|
/dashboard | /page1 |
/settings/profile | /mySettings |
/products | /product_list |
Use lowercase, hyphens for spaces, and descriptive names.
Organizing Routes
Section titled “Organizing Routes”For complex apps, group related routes:
/ → Home/dashboard → Dashboard/dashboard/stats → Detailed Stats/settings → Settings Overview/settings/profile → User Profile/settings/billing → Billing SettingsError Handling
Section titled “Error Handling”Consider creating:
- 404 page - For unknown routes
- Error page - For failures
- Loading page - For slow content
Route Examples
Section titled “Route Examples”Basic App
Section titled “Basic App”/ → Landing Page (default)/features → Features Page/pricing → Pricing Page/contact → Contact Form PageDashboard App
Section titled “Dashboard App”/ → Dashboard (default)/analytics → Analytics Page/reports → Reports Page/settings → Settings PageAPI App
Section titled “API App”/ → Documentation Page (default)/api/submit → Submit Handler (event)/api/status → Status Handler (event)/webhook → Webhook Handler (event)