mirror of https://github.com/voidlizard/hbs2
wip
This commit is contained in:
parent
8a6b18aff8
commit
046fd7a686
|
@ -1,6 +1,7 @@
|
|||
module Browser.Root
|
||||
( module Lucid
|
||||
, browserRootPage
|
||||
, channelPage
|
||||
) where
|
||||
|
||||
import HBS2.Prelude.Plated
|
||||
|
@ -116,3 +117,9 @@ browserRootPage syn = rootPage do
|
|||
p_ (toHtml s)
|
||||
|
||||
|
||||
|
||||
channelPage :: Monad m => RefChanId L4Proto -> HtmlT m ()
|
||||
channelPage chan = rootPage $ pure ()
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -217,6 +217,15 @@ httpWorker (PeerConfig syn) pmeta e = do
|
|||
get "/browser" do
|
||||
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
|
||||
-- FIXME: optional-header-based-authorization
|
||||
-- signed nonce + peer key?
|
||||
|
|
Loading…
Reference in New Issue