redirect /

This commit is contained in:
me 2024-11-01 19:46:26 +02:00
parent d3932e8282
commit 399e30434f

View File

@ -14,7 +14,13 @@ import Web.Twain qualified as Twain
routes :: DB -> FilePath -> [Twain.Middleware]
routes db detailsFile =
[ -- Match actor
[ Twain.get "/" do
details <- liftIO $ fetchUserDetails detailsFile
Twain.send $
Twain.redirect302 $
fromString ("/" <> details.username)
, -- Match actor
Twain.get (Fedi.matchUser $ unsafePerformIO $ fetchUserDetails detailsFile) do
request <- Twain.request
if Fedi.checkContentTypeAccept request