apps: individual apps send their %serve-dir poke

This commit is contained in:
Logan Allen 2020-05-28 14:47:34 -04:00
parent 9b5c93d2f1
commit 71d0b1a6c0
7 changed files with 49 additions and 14 deletions

View File

@ -87,7 +87,8 @@
^- (list (list card))
%+ turn ~(tap in keys) generate-cards
==
[loaded-cards.upgraded-state this(state upgraded-state)]
:_ this(state upgraded-state)
loaded-cards.upgraded-state
::
++ generate-cards
|= old-chat=path

View File

@ -118,6 +118,10 @@
:_ this
:~ [%pass / %arvo %e %disconnect [~ /'~chat']]
[%pass / %arvo %e %connect [~ /'chat-view'] %chat-view]
:* %pass /srv %agent [our.bol %file-server]
%poke %file-server-action
!>([%serve-dir /'~chat' /app/landscape %.n])
==
==
::
++ on-leave on-leave:def

View File

@ -11,8 +11,14 @@
*permission-hook
/+ *server, *contact-json, default-agent, dbug
|%
+$ state-0
$: %0
dir-served=_|
==
::
+$ card card:agent:gall
--
=| state-0
=* state -
::
%- agent:dbug
@ -28,20 +34,27 @@
^- (quip card _this)
:_ this
:~ [%pass /updates %agent [our.bowl %contact-store] %watch /updates]
(contact-poke:cc [%create /~/default])
(group-poke:cc [%bundle /~/default])
(contact-poke:cc [%add /~/default our.bowl *contact])
(group-poke:cc [%add [our.bowl ~ ~] /~/default])
:* %pass /srv %agent [our.bol %file-server]
%poke %file-server-action
!>([%serve-dir /'~groups' /app/landscape %.n])
==
==
::
++ on-save on-save:def
++ on-save !>(state)
++ on-load
|= old=*
^- (quip card _this)
:_ this
:_ this(dir-served %.y)
:~ [%pass / %arvo %e %disconnect [~ /'~groups']]
[%pass / %arvo %e %connect [~ /'contact-view'] %contact-view]
:* %pass /srv %agent [our.bol %file-server]
%poke %file-server-action
!>([%serve-dir /'~groups' /app/landscape %.n])
==
==
::
++ on-poke

View File

@ -30,16 +30,11 @@
%- ~(gas by *^serving)
%+ turn
^- (list path)
[/ /'~landscape' /'~chat' /'~link' /'~dojo' /'~groups' /'~publish' ~]
[/ /'~landscape' ~]
|=(pax=path [pax [/app/landscape %.n]])
==
:~ (connect /)
(connect /'~landscape')
(connect /'~chat')
(connect /'~link')
(connect /'~dojo')
(connect /'~groups')
(connect /'~publish')
==
::
++ connect
@ -75,8 +70,12 @@
?- -.act
%serve-dir
=* url-base url-base.act
?: (~(has by serving) url-base)
~|("url already bound to {<(~(got by serving) url-base.act)>}" !!)
=/ served (~(get by serving) url-base)
?^ served
?. =(clay-base.act clay-base.u.served)
~|("url already bound to {<(~(got by serving) url-base.act)>}" !!)
:- [%pass url-base %arvo %e %connect [~ url-base] %file-server]~
this(serving (~(put by serving) url-base [clay-base.act public.act]))
:- [%pass url-base %arvo %e %connect [~ url-base] %file-server]~
this(serving (~(put by serving) url-base [clay-base.act public.act]))
::

View File

@ -59,7 +59,12 @@
|= old=vase
^- (quip card _this)
:_ this(state !<(state-0 old))
[%pass /connect %arvo %e %disconnect [~ /'~link']]~
%+ welp
[%pass /connect %arvo %e %disconnect [~ /'~link']]~
:~ :* %pass /srv %agent [our.bowl %file-server]
%poke %file-server-action
!>([%serve-dir /'~link' /app/landscape %.n])
== ==
::
++ on-poke
|= [=mark =vase]

View File

@ -81,6 +81,10 @@
:* %pass / %agent [our.bol %invite-store] %poke %invite-action
!>([%create /publish])
==
:* %pass /srv %agent [our.bol %file-server]
%poke %file-server-action
!>([%serve-dir /'~publish' /app/landscape %.n])
==
==
::
++ on-save !>(state)
@ -105,6 +109,10 @@
/invitatory/publish
==
[%pass / %arvo %e %disconnect [~ /'~publish']]
:* %pass /srv %agent [our.bol %file-server]
%poke %file-server-action
!>([%serve-dir /'~publish' /app/landscape %.n])
==
==
=+ ^- [kick-cards=(list card) old-subs=(jug @tas @p)] kick-subs
=/ inv-scry-pax

View File

@ -24,7 +24,12 @@
++ on-load
|= old=vase
:_ this(state !<(state-zero old))
[%pass /bind/soto %arvo %e %disconnect [~ /'~dojo']]~
:~ [%pass /bind/soto %arvo %e %disconnect [~ /'~dojo']]
:* %pass /srv %agent [our.bol %file-server]
%poke %file-server-action
!>([%serve-dir /'~dojo' /app/landscape %.n])
==
==
::
++ on-poke on-poke:def
++ on-watch