Servant redirect to index

blankhart 2018-03-09 04:09:41.529598 UTC

1-- | Respond to requests at 'localhost:<port>/static'
2type StaticAPI = "static" :> GetIndex
3
4type GetIndex = Raw
5
6-- | Serve the single-page app at the static API
7serveSPA :: Server StaticAPI
8serveSPA = Tagged $ staticApp $ (defaultFileServerSettings (addTrailingPathSeparator staticFilePath))
9 { ssMaxAge = MaxAgeForever, ssRedirectToIndex = True }
10 where staticFilePath = "/absolute/filepath/static"