on master help sign in
Merge pull request #1221 from tinnus-napbus/fix-eyre-examples-html-tags
03c73bdtinnus-napbus
content/docs/arvo/eyre/examples.md+10−10
@@ -198,7 +198,7 @@ Server: urbit/vere-1.5
198set-cookie: urbauth-~zod=0v1.1pseu.tq7hs.hps2t.ltaf1.tmqjm; Path=/; Max-Age=604800
198set-cookie: urbauth-~zod=0v1.1pseu.tq7hs.hps2t.ltaf1.tmqjm; Path=/; Max-Age=604800
199content-type: text/html
199content-type: text/html
200
200
201−<html><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>There was an error while handling the request for /foo/bar/baz.json.</p><code>no scry result</code></body></html>
201+&lt;html>&lt;head>&lt;title>404 Not Found&lt;/title>&lt;/head>&lt;body>&lt;h1>Not Found&lt;/h1>&lt;p>There was an error while handling the request for /foo/bar/baz.json.&lt;/p>&lt;code>no scry result&lt;/code>&lt;/body>&lt;/html>
202```
202```
203
203
204## Direct HTTP Handling With Gall Agents
204## Direct HTTP Handling With Gall Agents
@@ -244,7 +244,7 @@ Note that this example does a lot of things manually for demonstrative purposes.
244 ~& [mark req]
244 ~& [mark req]
245 ?+ method.request.q.req
245 ?+ method.request.q.req
246 =/ data=octs
246 =/ data=octs
247− (as-octs:mimes:html '<h1>405 Method Not Allowed</h1>')
247+ (as-octs:mimes:html '&lt;h1>405 Method Not Allowed&lt;/h1>')
248 =/ content-length=@t
248 =/ content-length=@t
249 (crip ((d-co:co 1) p.data))
249 (crip ((d-co:co 1) p.data))
250 =/ =response-header:http
250 =/ =response-header:http
@@ -262,7 +262,7 @@ Note that this example does a lot of things manually for demonstrative purposes.
262 ::
262 ::
263 %'GET'
263 %'GET'
264 =/ data=octs
264 =/ data=octs
265− (as-octs:mimes:html '<h1>Hello, World!</h1>')
265+ (as-octs:mimes:html '&lt;h1>Hello, World!&lt;/h1>')
266 =/ content-length=@t
266 =/ content-length=@t
267 (crip ((d-co:co 1) p.data))
267 (crip ((d-co:co 1) p.data))
268 =/ =response-header:http
268 =/ =response-header:http
@@ -309,9 +309,9 @@ Note that this example does a lot of things manually for demonstrative purposes.
309Save the above to `/app/eyre-agent.hoon`. Commit it:
309Save the above to `/app/eyre-agent.hoon`. Commit it:
310
310
311```
311```
312−> |commit %base
312+> |commit %home
313>=
313>=
314−+ /~zod/base/2/app/eyre-agent/hoon
314++ /~zod/home/2/app/eyre-agent/hoon
315```
315```
316
316
317...and start it:
317...and start it:
@@ -320,7 +320,7 @@ Save the above to `/app/eyre-agent.hoon`. Commit it:
320> |start %eyre-agent
320> |start %eyre-agent
321>=
321>=
322gall: loading %eyre-agent
322gall: loading %eyre-agent
323−activated app base/eyre-agent
323+activated app home/eyre-agent
324[unlinked from [p=~zod q=%eyre-agent]]
324[unlinked from [p=~zod q=%eyre-agent]]
325```
325```
326
326
@@ -368,7 +368,7 @@ Content-Type: text/html
368Content-Length: 22
368Content-Length: 22
369transfer-encoding: chunked
369transfer-encoding: chunked
370
370
371−<h1>Hello, World!</h1>%
371+&lt;h1>Hello, World!&lt;/h1>%
372```
372```
373
373
374...which has succeed! This is because the `+on-poke` arm tests for http GET requests and responds with `Hello, World!` when it sees one:
374...which has succeed! This is because the `+on-poke` arm tests for http GET requests and responds with `Hello, World!` when it sees one:
@@ -376,7 +376,7 @@ transfer-encoding: chunked
376```hoon
376```hoon
377 %'GET'
377 %'GET'
378=/ data=octs
378=/ data=octs
379− (as-octs:mimes:html '<h1>Hello, World!</h1>')
379+ (as-octs:mimes:html '&lt;h1>Hello, World!&lt;/h1>')
380=/ content-length=@t
380=/ content-length=@t
381 (crip ((d-co:co 1) p.data))
381 (crip ((d-co:co 1) p.data))
382=/ =response-header:http
382=/ =response-header:http
@@ -430,7 +430,7 @@ Here we'll look at running a generator via Eyre. Eyre doesn't have a mediated JS
430
430
431You can refer to the [%serve](/docs/arvo/eyre/tasks#serve) section of the [Internal API Reference](/docs/arvo/eyre/tasks) document for relevant details.
431You can refer to the [%serve](/docs/arvo/eyre/tasks#serve) section of the [Internal API Reference](/docs/arvo/eyre/tasks) document for relevant details.
432
432
433−Here's a very simple generator that will just echo back the body of the request (if available) along with the current datetime. You can save it in the `/gen` directory and `|commit %base`.
433+Here's a very simple generator that will just echo back the body of the request (if available) along with the current datetime. You can save it in the `/gen` directory and `|commit %home`.
434
434
435Note that this example does some things manually for demonstrative purposes. In practice you'd likely want to use a library like `/lib/server.hoon` to cut down on boilerplate code.
435Note that this example does some things manually for demonstrative purposes. In practice you'd likely want to use a library like `/lib/server.hoon` to cut down on boilerplate code.
436
436
@@ -478,7 +478,7 @@ The [$binding](/docs/arvo/eyre/data-types#binding) specifies the site and URL pa
478Let's bind our generator to the `/mygen` URL path with the `|pass` command in the dojo:
478Let's bind our generator to the `/mygen` URL path with the `|pass` command in the dojo:
479
479
480```
480```
481−|pass [%e [%serve `/mygen %base /gen/eyre-gen/hoon ~]]
481+|pass [%e [%serve `/mygen %home /gen/eyre-gen/hoon ~]]
482```
482```
483
483
484Note that Eyre responds with a `%bound` `gift` to indicate whether the binding succeeded but `|pass` doesn't take such responses so it's not shown.
484Note that Eyre responds with a `%bound` `gift` to indicate whether the binding succeeded but `|pass` doesn't take such responses so it's not shown.