-
Notifications
You must be signed in to change notification settings - Fork 369
Overriding approot
Murray edited this page Jan 15, 2016
·
4 revisions
This page demonstrates different ways you may wish to override the approot
method.
This will use no root at all. Keep in mind this will not work with emails and RSS feeds.
approot = ApprootRelative
Note absence of trailing slash
approot = ApprootStatic "http://localhost"
Get a static application root from runtime configuration stored in the foundation datatype:
approot = ApprootMaster $ appRoot . appSettings
This will get the approot from the request header host field:
import Network.Wai (requestHeaderHost, isSecure)
approot = ApprootRequest $ \_ r -> maybe ""
(mappend (if isSecure r then "https://" else "http://") . decodeUtf8)
(requestHeaderHost r)
The first and unused parameter here is the master site.