This commit is contained in:
Dmitry Zuikov 2024-03-26 07:23:42 +03:00
parent 8a6b18aff8
commit 046fd7a686
2 changed files with 16 additions and 0 deletions

View File

@ -1,6 +1,7 @@
module Browser.Root module Browser.Root
( module Lucid ( module Lucid
, browserRootPage , browserRootPage
, channelPage
) where ) where
import HBS2.Prelude.Plated import HBS2.Prelude.Plated
@ -116,3 +117,9 @@ browserRootPage syn = rootPage do
p_ (toHtml s) p_ (toHtml s)
channelPage :: Monad m => RefChanId L4Proto -> HtmlT m ()
channelPage chan = rootPage $ pure ()

View File

@ -217,6 +217,15 @@ httpWorker (PeerConfig syn) pmeta e = do
get "/browser" do get "/browser" do
renderTextT (browserRootPage syn) >>= html renderTextT (browserRootPage syn) >>= html
get "/browser/channel/:refchan" $ void $ flip runContT pure do
chan <- lift (param @String "refchan")
<&> fromStringMay
>>= orElse (status status404)
lift $ renderTextT (channelPage chan) >>= html
put "/" do put "/" do
-- FIXME: optional-header-based-authorization -- FIXME: optional-header-based-authorization
-- signed nonce + peer key? -- signed nonce + peer key?