Restore the staticRoot option from older versions of Yesod's scaffolding, so I can host static files on a subdomain easily
This commit is contained in:
parent
a981947374
commit
1794e63bb0
3 changed files with 18 additions and 3 deletions
|
@ -77,6 +77,16 @@ instance Yesod App where
|
|||
120 -- timeout in minutes
|
||||
"config/client_session_key.aes"
|
||||
|
||||
-- Redirect static requests to a subdomain - this is recommended for best
|
||||
-- performance, since serving static files does not need your session
|
||||
-- cookies and they can be served from the frontend HTTP server without
|
||||
-- hitting the app server at all.
|
||||
-- https://github.com/yesodweb/yesod-cookbook/blob/master/cookbook/Serve-static-files-from-a-separate-domain.md
|
||||
urlParamRenderOverride app (StaticR s) _ = do
|
||||
staticRoot <- appStaticRoot . appSettings $ app
|
||||
return . uncurry (joinPath app staticRoot) . renderRoute $ s
|
||||
urlParamRenderOverride _ _ _ = Nothing
|
||||
|
||||
-- Yesod Middleware allows you to run code before and after each handler function.
|
||||
-- The defaultYesodMiddleware adds the response header "Vary: Accept, Accept-Language" and performs authorization checks.
|
||||
-- Some users may also want to add the defaultCsrfMiddleware, which:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue