Mercurial > hg > nginx-site
comparison xml/en/docs/stream/ngx_stream_js_module.xml @ 3011:55d49eb065ac
Fixed example in the js_periodic directive.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Thu, 14 Sep 2023 16:38:00 +0100 |
parents | 4470b2bff7b7 |
children | c0a4a4a55e45 |
comparison
equal
deleted
inserted
replaced
3010:758e2e1dfd22 | 3011:55d49eb065ac |
---|---|
7 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> | 7 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> |
8 | 8 |
9 <module name="Module ngx_stream_js_module" | 9 <module name="Module ngx_stream_js_module" |
10 link="/en/docs/stream/ngx_stream_js_module.html" | 10 link="/en/docs/stream/ngx_stream_js_module.html" |
11 lang="en" | 11 lang="en" |
12 rev="41"> | 12 rev="42"> |
13 | 13 |
14 <section id="summary"> | 14 <section id="summary"> |
15 | 15 |
16 <para> | 16 <para> |
17 The <literal>ngx_stream_js_module</literal> module is used to implement | 17 The <literal>ngx_stream_js_module</literal> module is used to implement |
517 } | 517 } |
518 | 518 |
519 example.js: | 519 example.js: |
520 | 520 |
521 async function handler(s) { | 521 async function handler(s) { |
522 let reply = async ngx.fetch('https://nginx.org/en/docs/njs/'); | 522 let reply = await ngx.fetch('https://nginx.org/en/docs/njs/'); |
523 let body = async reply.text(); | 523 let body = await reply.text(); |
524 | 524 |
525 ngx.log(ngx.INFO, body); | 525 ngx.log(ngx.INFO, body); |
526 } | 526 } |
527 </example> | 527 </example> |
528 </para> | 528 </para> |