Skip to content

Commit

Permalink
Added info about startPage to routing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mpscholten committed Aug 13, 2020
1 parent df79e55 commit aaff23d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Guide/routing.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@ instance FrontController WebApplication where

Now you can open e.g. `/Posts` to access the `PostsAction`.

## Changing the Start Page / Home Page

You can define a custom start page action using the `startPage` function like this:

```haskell
instance FrontController WebApplication where
controllers =
[ startPage ProjectsAction
-- Generator Marker
]
```

In a new IHP project, you usually have a `startPage WelcomeAction` defined. Make sure to remove this line. Otherwise you will still see the default IHP welcome page.

## Url Generation

Use `pathTo` to generate a path to a given action:
Expand Down

0 comments on commit aaff23d

Please sign in to comment.