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 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 ()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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?
|
||||||
|
|
Loading…
Reference in New Issue