mirror of
https://github.com/hanfel-dovned/shrubberish.git
synced 2024-11-23 22:26:48 +03:00
forward http requests to corresponding shrub
This commit is contained in:
parent
5ee7ceb19b
commit
217c044c86
@ -58,7 +58,10 @@
|
|||||||
++ on-watch
|
++ on-watch
|
||||||
|= =path
|
|= =path
|
||||||
^- (quip card _this)
|
^- (quip card _this)
|
||||||
`this
|
?> =(our.bowl src.bowl)
|
||||||
|
?+ path `this
|
||||||
|
[%http-response *] `this
|
||||||
|
==
|
||||||
::
|
::
|
||||||
++ on-leave on-leave:def
|
++ on-leave on-leave:def
|
||||||
++ on-fail on-fail:def
|
++ on-fail on-fail:def
|
||||||
@ -87,15 +90,36 @@
|
|||||||
::
|
::
|
||||||
++ init
|
++ init
|
||||||
^+ that
|
^+ that
|
||||||
that(shrubs (~(put by shrubs) /first [first !>(0)]))
|
=. shrubs
|
||||||
|
(~(put by shrubs) /first [first !>(0)])
|
||||||
|
%- emit
|
||||||
|
:* %pass /eyre/connect
|
||||||
|
%arvo %e %connect
|
||||||
|
`/shrubberish %shrubberish
|
||||||
|
==
|
||||||
::
|
::
|
||||||
:: Entry point.
|
:: Entry point.
|
||||||
++ poke
|
++ poke
|
||||||
|= [=mark =vase]
|
|= [=mark =vase]
|
||||||
^+ that
|
^+ that
|
||||||
?> =(%shrubberish-card mark)
|
?> (our.bowl src.bowl)
|
||||||
|
?+ mark !!
|
||||||
|
%shrubberish-card
|
||||||
=/ card !<(card:sh vase)
|
=/ card !<(card:sh vase)
|
||||||
(play [[card ~] ~])
|
(play [[card ~] ~])
|
||||||
|
::
|
||||||
|
%handle-http-request
|
||||||
|
=+ !<([eyre-id=@ta req=inbound-request:eyre] vase)
|
||||||
|
=/ parsed
|
||||||
|
%+ rash url.request.req
|
||||||
|
;~ plug
|
||||||
|
;~(pfix fas (more fas smeg:de-purl:html))
|
||||||
|
yque:de-purl:html
|
||||||
|
==
|
||||||
|
=/ card
|
||||||
|
[-.parsed [%poke %handle-http-request vase]]
|
||||||
|
(play [[card ~] ~])
|
||||||
|
==
|
||||||
::
|
::
|
||||||
:: Apply the next card to the namespace.
|
:: Apply the next card to the namespace.
|
||||||
++ play
|
++ play
|
||||||
@ -108,11 +132,6 @@
|
|||||||
-.async
|
-.async
|
||||||
-.stack
|
-.stack
|
||||||
?- -.act.card
|
?- -.act.card
|
||||||
%read
|
|
||||||
=/ shrub (~(got by shrubs) path.card)
|
|
||||||
~& > +7.shrub
|
|
||||||
that
|
|
||||||
::
|
|
||||||
%make
|
%make
|
||||||
=/ shrub shrub.act.card
|
=/ shrub shrub.act.card
|
||||||
=/ vase vase.act.card
|
=/ vase vase.act.card
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
+$ act
|
+$ act
|
||||||
$% [%make =shrub =cage =vase]
|
$% [%make =shrub =cage =vase]
|
||||||
[%poke =cage]
|
[%poke =cage]
|
||||||
[%read ~]
|
|
||||||
==
|
==
|
||||||
+$ shrub
|
+$ shrub
|
||||||
$_ ^|
|
$_ ^|
|
||||||
|
Loading…
Reference in New Issue
Block a user