2019-06-28 21:22:11 +03:00
|
|
|
/+ *server, launch
|
2019-06-05 00:29:53 +03:00
|
|
|
/= index
|
2019-06-21 21:35:28 +03:00
|
|
|
/^ $-(marl manx)
|
|
|
|
/: /===/app/launch/index /!noun/
|
2019-06-05 00:29:53 +03:00
|
|
|
/= script
|
|
|
|
/^ octs
|
|
|
|
/; as-octs:mimes:html
|
|
|
|
/: /===/app/launch/js/index
|
|
|
|
/| /js/
|
|
|
|
/~ ~
|
|
|
|
==
|
|
|
|
/= style
|
|
|
|
/^ octs
|
|
|
|
/; as-octs:mimes:html
|
|
|
|
/: /===/app/launch/css/index
|
|
|
|
/| /css/
|
|
|
|
/~ ~
|
|
|
|
==
|
|
|
|
/= launch-png
|
|
|
|
/^ (map knot @)
|
|
|
|
/: /===/app/launch/img /_ /png/
|
|
|
|
::
|
2019-06-28 21:22:11 +03:00
|
|
|
=, launch
|
2019-06-05 00:29:53 +03:00
|
|
|
::
|
|
|
|
|_ [bol=bowl:gall sta=state]
|
|
|
|
::
|
|
|
|
++ this .
|
|
|
|
::
|
|
|
|
++ prep
|
|
|
|
|= old=(unit state)
|
|
|
|
^- (quip move _this)
|
|
|
|
?~ old
|
|
|
|
:_ this
|
|
|
|
[ost.bol %connect / [~ /] %launch]~
|
|
|
|
[~ this(sta u.old)]
|
|
|
|
::
|
2019-06-28 21:22:11 +03:00
|
|
|
++ poke-launch-action
|
|
|
|
|= act=action:launch
|
2019-06-05 00:29:53 +03:00
|
|
|
^- (quip move _this)
|
2019-06-28 21:22:11 +03:00
|
|
|
=/ beforedata (~(get by data.sta) name.act)
|
2019-06-21 21:35:28 +03:00
|
|
|
=/ newdata
|
|
|
|
?~ beforedata
|
2019-06-28 21:22:11 +03:00
|
|
|
(~(put by data.sta) name.act [*json url.act])
|
|
|
|
(~(put by data.sta) name.act [jon.u.beforedata url.act])
|
|
|
|
:- [ost.bol %peer subscribe.act [our.bol name.act] subscribe.act]~
|
2019-06-05 00:29:53 +03:00
|
|
|
%= this
|
2019-06-28 21:22:11 +03:00
|
|
|
tiles.sta (~(put in tiles.sta) [name.act subscribe.act])
|
2019-06-21 21:35:28 +03:00
|
|
|
data.sta newdata
|
2019-06-28 21:22:11 +03:00
|
|
|
path-to-tile.sta (~(put by path-to-tile.sta) subscribe.act name.act)
|
2019-06-05 00:29:53 +03:00
|
|
|
==
|
|
|
|
::
|
2019-06-28 21:22:11 +03:00
|
|
|
++ peer-main
|
|
|
|
|= [pax=path]
|
|
|
|
^- (quip move _this)
|
|
|
|
=/ data/json
|
|
|
|
%- pairs:enjs:format
|
|
|
|
%+ turn ~(tap by data.sta)
|
|
|
|
|= [key=@tas [jon=json url=@t]]
|
|
|
|
[key jon]
|
|
|
|
:_ this
|
|
|
|
[ost.bol %diff %json data]~
|
|
|
|
::
|
2019-06-05 00:29:53 +03:00
|
|
|
++ diff-json
|
|
|
|
|= [pax=path jon=json]
|
2019-06-21 21:35:28 +03:00
|
|
|
^- (quip move _this)
|
2019-06-05 00:29:53 +03:00
|
|
|
=/ name/@tas (~(got by path-to-tile.sta) pax)
|
2019-06-21 21:35:28 +03:00
|
|
|
=/ data/(unit [json url=@t]) (~(get by data.sta) name)
|
|
|
|
?~ data
|
|
|
|
[~ this]
|
2019-06-28 00:43:19 +03:00
|
|
|
::
|
2019-06-05 00:29:53 +03:00
|
|
|
:-
|
|
|
|
%+ turn (prey:pubsub:userlib /main bol)
|
2019-06-28 00:43:19 +03:00
|
|
|
|= [=bone *]
|
|
|
|
[bone %diff %json (frond:enjs:format name jon)]
|
|
|
|
::
|
2019-06-05 00:29:53 +03:00
|
|
|
%= this
|
2019-06-21 21:35:28 +03:00
|
|
|
data.sta (~(put by data.sta) name [jon url.u.data])
|
2019-06-05 00:29:53 +03:00
|
|
|
==
|
|
|
|
::
|
2019-06-21 21:35:28 +03:00
|
|
|
++ generate-script-marl
|
|
|
|
|= data=tile-data
|
|
|
|
^- marl
|
|
|
|
%+ turn ~(tap by data)
|
2019-06-28 00:43:19 +03:00
|
|
|
|= [key=@tas [jon=json url=@t]]
|
|
|
|
^- manx
|
|
|
|
;script@"{(trip url)}";
|
2019-06-21 21:35:28 +03:00
|
|
|
::
|
2019-06-05 00:29:53 +03:00
|
|
|
++ poke-handle-http-request
|
|
|
|
%- (require-authorization:app ost.bol move this)
|
2019-07-04 09:09:44 +03:00
|
|
|
|= =inbound-request:eyre
|
2019-06-05 00:29:53 +03:00
|
|
|
^- (quip move _this)
|
|
|
|
::
|
2019-06-28 21:22:11 +03:00
|
|
|
=/ request-line (parse-request-line url.request.inbound-request)
|
2019-06-05 00:29:53 +03:00
|
|
|
=/ name=@t
|
2019-06-28 21:22:11 +03:00
|
|
|
=/ back-path (flop site.request-line)
|
2019-06-05 00:29:53 +03:00
|
|
|
?~ back-path
|
|
|
|
''
|
|
|
|
i.back-path
|
|
|
|
=/ site (flop site.request-line)
|
|
|
|
?~ site
|
2019-06-21 21:35:28 +03:00
|
|
|
=/ hym=manx (index (generate-script-marl data.sta))
|
2019-06-05 00:29:53 +03:00
|
|
|
:_ this
|
2019-06-21 21:35:28 +03:00
|
|
|
[ost.bol %http-response (manx-response:app hym)]~
|
2019-06-05 00:29:53 +03:00
|
|
|
?+ site.request-line
|
|
|
|
:_ this
|
|
|
|
[ost.bol %http-response not-found:app]~
|
|
|
|
::
|
|
|
|
:: styling
|
|
|
|
::
|
|
|
|
[%'~launch' %css %index ~]
|
|
|
|
:_ this
|
|
|
|
[ost.bol %http-response (css-response:app style)]~
|
|
|
|
::
|
|
|
|
:: javascript
|
|
|
|
::
|
|
|
|
[%'~launch' %js %index ~]
|
|
|
|
:_ this
|
|
|
|
[ost.bol %http-response (js-response:app script)]~
|
|
|
|
::
|
|
|
|
:: images
|
|
|
|
::
|
|
|
|
[%'~launch' %img *]
|
|
|
|
=/ img (as-octs:mimes:html (~(got by launch-png) `@ta`name))
|
|
|
|
:_ this
|
|
|
|
[ost.bol %http-response (png-response:app img)]~
|
|
|
|
==
|
|
|
|
::
|
2019-06-28 21:22:11 +03:00
|
|
|
++ bound
|
2019-07-05 23:04:02 +03:00
|
|
|
|= [wir=wire success=? binding=binding:eyre]
|
2019-06-28 21:22:11 +03:00
|
|
|
^- (quip move _this)
|
|
|
|
[~ this]
|
|
|
|
::
|
2019-06-05 00:29:53 +03:00
|
|
|
--
|