added kiss-eyre %serv setting web server root beam

|serve ?(desk path:beam) to set
This commit is contained in:
Anton Dyudin 2015-12-04 14:21:37 -08:00
parent cb6f946abb
commit f9e6503815
6 changed files with 41 additions and 7 deletions

View File

@ -102,6 +102,7 @@
++ poke-helm-reload (wrap poke-reload):from-helm
++ poke-helm-reload-desk (wrap poke-reload-desk):from-helm
++ poke-helm-reset (wrap poke-reset):from-helm
++ poke-helm-serve (wrap poke-serve):from-helm
++ poke-helm-send-hi (wrap poke-send-hi):from-helm
++ poke-helm-send-ask (wrap poke-send-ask):from-helm
++ poke-helm-verb (wrap poke-verb):from-helm

View File

@ -66,9 +66,10 @@
-- ::
|% :: models
++ bolo :: eyre state
$: %3 :: version
$: %4 :: version
gub=@t :: random identity
hov=(unit ship) :: master for remote
top=beam :: ford serve prefix
ged=duct :: client interface
ded=(set duct) :: killed requests
lyv=(map duct live) :: living requests
@ -561,13 +562,19 @@
|= kyz=kiss
^+ +>
=. our ?~(hov our u.hov) :: XX
=. p.top our :: XX necessary?
?- -.kyz
%born +>.$(ged hen) :: register external
%serv
=< ~&([%serving (tope top)] .)
?^(p.kyz +>.$(top p.kyz) +>.$(q.top p.kyz))
::
%crud
+>.$(mow [[hen %slip %d %flog kyz] mow])
::
%init :: register ownership
+>.$(hov ?~(hov [~ p.kyz] [~ (min u.hov p.kyz)]))
=. our ?~(hov p.kyz (min u.hov p.kyz))
+>.$(hov [~ our], top [[our %home ud/0] /web])
::
%this :: inbound request
%- emule |. ^+ ..apex
@ -1595,19 +1602,21 @@
~
::
++ load :: take previous state
=+ bolo-3=,_[%3 +(|2 |3.+)]:*bolo :: no top
=+ even-2=?(even [%mean p=[dock path] *]) :: old %quit
=+ ^= stem-2 :: no die, sus
,_=+(*stem -(|3 |5.-, q.eve *(map ,@u even-2)))
=+ bolo-2=,_[%2 %*(+ *bolo wix *(map ixor stem-2))]
=+ bolo-2=,_[%2 %*(+ *bolo-3 wix *(map ixor stem-2))]
=+ bolo-1=,_[%1 +(|4 |5.+)]:*bolo-2 :: no lyv
|= old=?(bolo bolo-1 bolo-2)
|= old=?(bolo bolo-1 bolo-2 bolo-3)
^+ ..^$
?- -.old
%3 ..^$(+>- old)
%4 ..^$(+>- old)
%3 $(-.old %4, |2.+.old [[[(need hov.old) %home ud/0] /web] |2.+.old])
%2 =+ evn=|=(a=even-2 ?+(-.a a %mean [%quit p.a]))
=+ stm=|=(a=stem-2 a(|3 [now ~ |3.a(q.eve (~(run by q.eve.a) evn))]))
$(old [%3 +.old(wix (~(run by wix.old) stm))])
%1 $(old [%2 +(|4 [~ |4.+])]:old)
$(-.old %3, wix.old (~(run by wix.old) stm))
%1 $(-.old %2, |4.+.old [~ |4.+.old])
==
::
++ scry

View File

@ -1166,6 +1166,7 @@
%merg `%c
%mont `%c
%ogre `%c
%serv `%e
%them `%e
%wait `%b
%want `%a

View File

@ -2478,6 +2478,7 @@
[%crud p=@tas q=(list tank)] :: XX rethink
[%hiss p=mark q=cage] :: outbound user req
[%init p=@p] :: report install
[%serv p=$|(desk beam)] :: set serving root
[%them p=(unit hiss)] :: outbound request
[%they p=@ud q=httr] :: inbound response
[%this p=? q=clip r=httq] :: inbound request

17
gen/hood/serve.hoon Normal file
View File

@ -0,0 +1,17 @@
::
:::: /hoon/serve/hood/gen
::
/? 314
::
::::
!:
:- %say
|= $: [now=@da eny=@uvI bec=beak]
[[pax=$|(term [i=span t=path]) ~] ~]
==
:- %helm-serve
?@ pax pax
=+ bem=(need (tome pax))
?. =([%da now] r.bem) :: XX actual sentinel
bem
bem(r [%ud 0])

View File

@ -47,6 +47,7 @@
$% [%cash wire p=@p q=buck] ::
[%conf wire dock %load ship term] ::
[%flog wire flog] ::
[%serv wire ?(desk beam)] ::
[%poke wire dock pear] ::
[%wont wire sock path *] :: send message
== ::
@ -94,6 +95,10 @@
%^ emit %poke /helm/ask/(scot %p ~doznec)
[[~doznec %ask] %ask-mail mel]
::
++ poke-serve
|= top=?(desk beam) =< abet
(emit %serv /helm/serv top)
::
++ poke-hi |=(mes=@t abet:(emit %flog /di %text "< {<src>}: {(trip mes)}"))
++ coup-hi
|= [pax=path cop=(unit tang)] =< abet