# HG changeset patch # User Yaroslav Zhuravlev # Date 1529430213 -10800 # Node ID dfc49994218c456152fa813237d55201a26ae20a # Parent 23cfb62121d124b465fd1e14234b2cba73f04feb Updated example in HTTP njs module. diff -r 23cfb62121d1 -r dfc49994218c xml/en/docs/http/ngx_http_js_module.xml --- a/xml/en/docs/http/ngx_http_js_module.xml Tue Jun 19 20:43:33 2018 +0300 +++ b/xml/en/docs/http/ngx_http_js_module.xml Tue Jun 19 20:43:33 2018 +0300 @@ -9,7 +9,7 @@ + rev="14">
@@ -33,21 +33,30 @@ -js_include http.js; +load_module modules/ngx_http_js_module.so; +... + +http { + js_include http.js; -js_set $foo foo; -js_set $summary summary; + js_set $foo foo; + js_set $summary summary; -server { - listen 8000; + server { + listen 8000; - location / { - add_header X-Foo $foo; - js_content baz; - } + location / { + add_header X-Foo $foo; + js_content baz; + } - location /summary { - return 200 $summary; + location /summary { + return 200 $summary; + } + + location /hello { + js_content hello; + } } } @@ -97,6 +106,10 @@ r.finish(); } + +function hello(r) { + r.return(200, "Hello world!"); +} diff -r 23cfb62121d1 -r dfc49994218c xml/en/docs/stream/ngx_stream_js_module.xml --- a/xml/en/docs/stream/ngx_stream_js_module.xml Tue Jun 19 20:43:33 2018 +0300 +++ b/xml/en/docs/stream/ngx_stream_js_module.xml Tue Jun 19 20:43:33 2018 +0300 @@ -32,6 +32,9 @@ +load_module modules/ngx_stream_js_module.so; +... + stream { js_include stream.js; diff -r 23cfb62121d1 -r dfc49994218c xml/ru/docs/http/ngx_http_js_module.xml --- a/xml/ru/docs/http/ngx_http_js_module.xml Tue Jun 19 20:43:33 2018 +0300 +++ b/xml/ru/docs/http/ngx_http_js_module.xml Tue Jun 19 20:43:33 2018 +0300 @@ -9,7 +9,7 @@ + rev="14">
@@ -33,21 +33,30 @@ -js_include http.js; +load_module modules/ngx_http_js_module.so; +... + +http { + js_include http.js; -js_set $foo foo; -js_set $summary summary; + js_set $foo foo; + js_set $summary summary; -server { - listen 8000; + server { + listen 8000; - location / { - add_header X-Foo $foo; - js_content baz; - } + location / { + add_header X-Foo $foo; + js_content baz; + } - location /summary { - return 200 $summary; + location /summary { + return 200 $summary; + } + + location /hello { + js_content hello; + } } } @@ -97,6 +106,10 @@ r.finish(); } + +function hello(r) { + r.return(200, "Hello world!"); +} diff -r 23cfb62121d1 -r dfc49994218c xml/ru/docs/stream/ngx_stream_js_module.xml --- a/xml/ru/docs/stream/ngx_stream_js_module.xml Tue Jun 19 20:43:33 2018 +0300 +++ b/xml/ru/docs/stream/ngx_stream_js_module.xml Tue Jun 19 20:43:33 2018 +0300 @@ -32,6 +32,9 @@ +load_module modules/ngx_stream_js_module.so; +... + stream { js_include stream.js;