shrub/pkg/arvo/app/modulo.hoon

52 lines
1.0 KiB
Plaintext
Raw Normal View History

2019-03-12 03:05:24 +03:00
/+ *server
|%
:: +move: output effect
::
+$ move [bone card]
:: +card: output effect payload
::
+$ card
$% [%connect wire binding:eyre term]
[%disconnect wire binding:eyre]
2019-03-12 03:05:24 +03:00
[%http-response =http-event:http]
2019-03-13 03:47:57 +03:00
==
::
2019-03-12 03:05:24 +03:00
--
::
|_ [bow=bowl:gall ~]
2019-03-12 03:05:24 +03:00
::
++ this .
::
++ prep
|= old=(unit *)
^- (quip move _this)
?~ old
:_ this
[ost.bow %connect / [~ /'~modulo'] %modulo]~
2019-03-30 02:04:34 +03:00
[~ this]
::
2019-03-12 03:05:24 +03:00
:: alerts us that we were bound. we need this because the vane calls back.
::
++ bound
|= [wir=wire success=? binding=binding:eyre]
2019-03-30 02:04:34 +03:00
^- (quip move _this)
2019-03-12 03:05:24 +03:00
[~ this]
::
++ session-js
^- octs
2019-03-30 02:04:34 +03:00
%- as-octt:mimes:html
2019-03-30 02:27:36 +03:00
;: weld
2019-03-30 02:04:34 +03:00
"window.ship = '{+:(scow %p our.bow)}';"
2019-03-30 02:27:36 +03:00
"window.urb = new Channel();"
==
::
2019-03-12 03:05:24 +03:00
:: +poke-handle-http-request: received on a new connection established
::
++ poke-handle-http-request
%- (require-authorization:app ost.bow move this)
|= =inbound-request:eyre
2019-03-12 03:05:24 +03:00
^- (quip move _this)
[[ost.bow %http-response (js-response:app session-js)]~ this]
2019-03-12 03:05:24 +03:00
::
--