My site is built in Haskell/Servant and Wai/Warp. I need to redirect all requests from my domain.com
to www.domain.com
with the the 301 or 302 status. I know I can do that with the help of Wai/Warp somehow. How exactly?
startApp :: IO ()
startApp = run 1234 app
The package
wai-util
has a convenience functionredirect'
to create such aResponse
, so you should be able to do something like