From aaff23d44edbad143a95ec37b55e41be70352060 Mon Sep 17 00:00:00 2001 From: Marc Scholten Date: Thu, 13 Aug 2020 09:41:07 +0200 Subject: [PATCH] Added info about startPage to routing docs --- Guide/routing.markdown | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Guide/routing.markdown b/Guide/routing.markdown index 907380736..1142f6569 100644 --- a/Guide/routing.markdown +++ b/Guide/routing.markdown @@ -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: