mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-15 18:12:47 +03:00
We now have an application path rendering
This commit is contained in:
parent
3048166697
commit
c733dba149
@ -424,6 +424,7 @@
|
|||||||
+>.$
|
+>.$
|
||||||
(dump:(crud %reap u.p.p.+>.sih) %logo ~)
|
(dump:(crud %reap u.p.p.+>.sih) %logo ~)
|
||||||
$diff pump:(from ((hard dill-blit) q:`vase`+>+>.sih))
|
$diff pump:(from ((hard dill-blit) q:`vase`+>+>.sih))
|
||||||
|
$http-response !!
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
{$c $note *}
|
{$c $note *}
|
||||||
|
@ -943,6 +943,8 @@
|
|||||||
(get-rush:(ire-ix p.tee) q.tee ((hard json) q.q.p.cuf))
|
(get-rush:(ire-ix p.tee) q.tee ((hard json) q.q.p.cuf))
|
||||||
::
|
::
|
||||||
$quit ~&(quit+tee (get-quit:(ire-ix p.tee) q.tee))
|
$quit ~&(quit+tee (get-quit:(ire-ix p.tee) q.tee))
|
||||||
|
:: ironically, old eyre will never get an http-response.
|
||||||
|
$http-response !!
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
$wake
|
$wake
|
||||||
|
@ -399,6 +399,9 @@
|
|||||||
$quit %+ mo-pass [%sys pax]
|
$quit %+ mo-pass [%sys pax]
|
||||||
[%a %want [our him] [%g %gh dap ~] [num %x ~]]
|
[%a %want [our him] [%g %gh dap ~] [num %x ~]]
|
||||||
$reap (mo-give %mack p.cuf)
|
$reap (mo-give %mack p.cuf)
|
||||||
|
:: we send http-responses, we don't receive them.
|
||||||
|
::
|
||||||
|
$http-response !!
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
%val :: inbound validate
|
%val :: inbound validate
|
||||||
@ -609,7 +612,12 @@
|
|||||||
$hiss `note-arvo`[%e %hiss +.q.q.cov]
|
$hiss `note-arvo`[%e %hiss +.q.q.cov]
|
||||||
$send `note-arvo`[%g %deal [our p.q.q.cov] q.q.q.cov]
|
$send `note-arvo`[%g %deal [our p.q.q.cov] q.q.q.cov]
|
||||||
$meta `note-arvo`[`@tas`p.q.q.cov %meta `vase`q.q.q.cov]
|
$meta `note-arvo`[`@tas`p.q.q.cov %meta `vase`q.q.q.cov]
|
||||||
|
:: $response `note-arvo`[%l %response raw-http-response.q.q.cov]
|
||||||
==
|
==
|
||||||
|
::
|
||||||
|
:: I'm sort of stumped on how to get a %give out of the above; it's
|
||||||
|
:: just turning %cove into a %pass instead.
|
||||||
|
::
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ ap-avid :: onto results
|
++ ap-avid :: onto results
|
||||||
@ -793,6 +801,7 @@
|
|||||||
$poke (ap-move-poke -.q.vax cav)
|
$poke (ap-move-poke -.q.vax cav)
|
||||||
$send (ap-move-send -.q.vax cav)
|
$send (ap-move-send -.q.vax cav)
|
||||||
$quit (ap-move-quit -.q.vax cav)
|
$quit (ap-move-quit -.q.vax cav)
|
||||||
|
$http-response (ap-move-http-response -.q.vax cav)
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ ap-move-quit :: give quit move
|
++ ap-move-quit :: give quit move
|
||||||
@ -811,6 +820,15 @@
|
|||||||
=^ tel vel (~(slot wa vel) 3 pec)
|
=^ tel vel (~(slot wa vel) 3 pec)
|
||||||
:_(+>.$ [%& sto %give %diff `cage`[-.q.pec tel]])
|
:_(+>.$ [%& sto %give %diff `cage`[-.q.pec tel]])
|
||||||
::
|
::
|
||||||
|
++ ap-move-http-response
|
||||||
|
|= [sto=bone vax=vase]
|
||||||
|
^- [(each cove tang) _+>]
|
||||||
|
::
|
||||||
|
:: TODO: Magic vase validation. I have no idea how malformed checking works.
|
||||||
|
::
|
||||||
|
:_ +>.$
|
||||||
|
[%& sto %give %http-response ((hard raw-http-response:light) q.vax)]
|
||||||
|
::
|
||||||
++ ap-move-hiss :: pass %hiss
|
++ ap-move-hiss :: pass %hiss
|
||||||
|= {sto/bone vax/vase}
|
|= {sto/bone vax/vase}
|
||||||
^- {(each cove tang) _+>}
|
^- {(each cove tang) _+>}
|
||||||
@ -1072,6 +1090,8 @@
|
|||||||
$diff (ap-diff q.q.pry pax p.cuf)
|
$diff (ap-diff q.q.pry pax p.cuf)
|
||||||
$quit (ap-take q.q.pry %quit +.pax ~)
|
$quit (ap-take q.q.pry %quit +.pax ~)
|
||||||
$reap (ap-take q.q.pry %reap +.pax `!>(p.cuf))
|
$reap (ap-take q.q.pry %reap +.pax `!>(p.cuf))
|
||||||
|
:: ???
|
||||||
|
$http-response !!
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ ap-prep :: install
|
++ ap-prep :: install
|
||||||
@ -1247,6 +1267,7 @@
|
|||||||
$well `%e
|
$well `%e
|
||||||
$well `%e
|
$well `%e
|
||||||
$wipe `%f
|
$wipe `%f
|
||||||
|
%connect `%l
|
||||||
==
|
==
|
||||||
--
|
--
|
||||||
--
|
--
|
||||||
|
@ -44,8 +44,11 @@
|
|||||||
$: %g
|
$: %g
|
||||||
:: %response: http-response from a gall app
|
:: %response: http-response from a gall app
|
||||||
::
|
::
|
||||||
[%response =raw-http-response]
|
$% [%response =raw-http-response]
|
||||||
== ==
|
::
|
||||||
|
::
|
||||||
|
[%unto p=cuft:gall]
|
||||||
|
== == ==
|
||||||
--
|
--
|
||||||
:: more structures
|
:: more structures
|
||||||
::
|
::
|
||||||
@ -199,7 +202,6 @@
|
|||||||
++ request
|
++ request
|
||||||
|= [secure=? =address =http-request]
|
|= [secure=? =address =http-request]
|
||||||
^- [(list move) server-state]
|
^- [(list move) server-state]
|
||||||
~& [%request secure address http-request]
|
|
||||||
::
|
::
|
||||||
=+ host=(get-header 'host' header-list.http-request)
|
=+ host=(get-header 'host' header-list.http-request)
|
||||||
=+ action=(get-action-for-binding host url.http-request)
|
=+ action=(get-action-for-binding host url.http-request)
|
||||||
@ -511,6 +513,19 @@
|
|||||||
^- ?
|
^- ?
|
||||||
&(=(item-binding binding) =(item-duct duct))
|
&(=(item-binding binding) =(item-duct duct))
|
||||||
==
|
==
|
||||||
|
:: +simplified-url-parser: returns [(each @if @t) (unit port=@ud)]
|
||||||
|
::
|
||||||
|
++ simplified-url-parser
|
||||||
|
;~ plug
|
||||||
|
;~ pose
|
||||||
|
(stag %site (cook crip (star ;~(pose dot dit))))
|
||||||
|
(stag %ip (cook crip (star ;~(pose dot alp))))
|
||||||
|
==
|
||||||
|
;~ pose
|
||||||
|
(stag ~ ;~(pfix col dim:ag))
|
||||||
|
(easy ~)
|
||||||
|
==
|
||||||
|
==
|
||||||
:: +get-action-for-binding: finds an action for an incoming web request
|
:: +get-action-for-binding: finds an action for an incoming web request
|
||||||
::
|
::
|
||||||
++ get-action-for-binding
|
++ get-action-for-binding
|
||||||
@ -527,19 +542,25 @@
|
|||||||
=/ host=(unit @t)
|
=/ host=(unit @t)
|
||||||
?~ raw-host
|
?~ raw-host
|
||||||
~
|
~
|
||||||
:: TODO: Check IP addresses. I can't just check the
|
:: Parse the raw-host so that we can ignore ports, usernames, etc.
|
||||||
:: `\d{0-3}\.\d{0-3}...` regex here.
|
|
||||||
::
|
|
||||||
:: TODO: Check for localhost
|
|
||||||
::
|
|
||||||
:: render our as a tape, and cut off the sig in front.
|
|
||||||
::
|
|
||||||
=/ with-sig=tape (scow %p our)
|
|
||||||
?> ?=(^ with-sig)
|
|
||||||
?: =(u.raw-host (crip t.with-sig))
|
|
||||||
:: [our].urbit.org is the default site
|
|
||||||
::
|
::
|
||||||
|
?~ parsed=(rush u.raw-host simplified-url-parser)
|
||||||
|
~& [%doesnt-parse u.raw-host]
|
||||||
~
|
~
|
||||||
|
:: if the url is a raw IP, assume default site.
|
||||||
|
::
|
||||||
|
:: ?: ?=([%ip *] u.parsed)
|
||||||
|
:: ~
|
||||||
|
:: :: TODO: Check for localhost
|
||||||
|
:: ::
|
||||||
|
:: :: render our as a tape, and cut off the sig in front.
|
||||||
|
:: ::
|
||||||
|
:: =/ with-sig=tape (scow %p our)
|
||||||
|
:: ?> ?=(^ with-sig)
|
||||||
|
:: ?: =(u.raw-host (crip t.with-sig))
|
||||||
|
:: :: [our].urbit.org is the default site
|
||||||
|
:: ::
|
||||||
|
:: ~
|
||||||
::
|
::
|
||||||
raw-host
|
raw-host
|
||||||
:: url is the raw thing passed over the 'Request-Line'.
|
:: url is the raw thing passed over the 'Request-Line'.
|
||||||
@ -681,11 +702,18 @@
|
|||||||
~|([%bad-take-wire wire] !!)
|
~|([%bad-take-wire wire] !!)
|
||||||
::
|
::
|
||||||
++ run-app
|
++ run-app
|
||||||
?> ?=([%g %response *] sign)
|
?. ?=([%g %unto *] sign)
|
||||||
|
~|([%bad-take-app wire sign] !!)
|
||||||
|
::
|
||||||
|
?. ?=([%g %unto %http-response *] sign)
|
||||||
|
:: entirely normal to get things other than http-response calls, but we
|
||||||
|
:: don't care.
|
||||||
|
::
|
||||||
|
[~ light-gate]
|
||||||
::
|
::
|
||||||
=/ event-args [[(need ship.ax) eny duct now scry-gate] server-state.ax]
|
=/ event-args [[(need ship.ax) eny duct now scry-gate] server-state.ax]
|
||||||
=/ handle-response handle-response:(per-server-event event-args)
|
=/ handle-response handle-response:(per-server-event event-args)
|
||||||
=^ moves server-state.ax (handle-response raw-http-response.sign)
|
=^ moves server-state.ax (handle-response raw-http-response.p.sign)
|
||||||
[moves light-gate]
|
[moves light-gate]
|
||||||
--
|
--
|
||||||
::
|
::
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
!:
|
|
||||||
:: :: /van/zuse
|
:: :: /van/zuse
|
||||||
:: :: %reference/1
|
:: :: %reference/1
|
||||||
:: %zuse: arvo library.
|
:: %zuse: arvo library.
|
||||||
@ -1927,6 +1926,7 @@
|
|||||||
{$diff p/cage} :: subscription output
|
{$diff p/cage} :: subscription output
|
||||||
{$quit ~} :: close subscription
|
{$quit ~} :: close subscription
|
||||||
{$reap p/(unit tang)} :: peer result
|
{$reap p/(unit tang)} :: peer result
|
||||||
|
[%http-response =raw-http-response:light] :: serve http result
|
||||||
== ::
|
== ::
|
||||||
++ culm :: config action
|
++ culm :: config action
|
||||||
$% {$load p/scup} :: load+reload
|
$% {$load p/scup} :: load+reload
|
||||||
@ -7354,6 +7354,7 @@
|
|||||||
{$f task:able:ford}
|
{$f task:able:ford}
|
||||||
{$g task:able:gall}
|
{$g task:able:gall}
|
||||||
{$j task:able:jael}
|
{$j task:able:jael}
|
||||||
|
{$l task:able:light}
|
||||||
{@tas $meta vase}
|
{@tas $meta vase}
|
||||||
==
|
==
|
||||||
++ sign-arvo :: in result $<-
|
++ sign-arvo :: in result $<-
|
||||||
@ -7365,6 +7366,7 @@
|
|||||||
{$f gift:able:ford}
|
{$f gift:able:ford}
|
||||||
{$g gift:able:gall}
|
{$g gift:able:gall}
|
||||||
{$j gift:able:jael}
|
{$j gift:able:jael}
|
||||||
|
{%l gift:able:light}
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ unix-task :: input from unix
|
++ unix-task :: input from unix
|
||||||
|
Loading…
Reference in New Issue
Block a user