# HG changeset patch # User Yaroslav Zhuravlev # Date 1666351147 -3600 # Node ID 9719a0184a670bfcaf88e44d20b05e9f4250b2cf # Parent e4a87f3a05d851f874bcbe8750280929eb5f9894 Documented the js_preload_object directive. diff --git a/xml/en/docs/http/ngx_http_js_module.xml b/xml/en/docs/http/ngx_http_js_module.xml --- a/xml/en/docs/http/ngx_http_js_module.xml +++ b/xml/en/docs/http/ngx_http_js_module.xml @@ -9,7 +9,7 @@ + rev="37">
@@ -539,6 +539,35 @@ since + +name.json | +name from file.json + +http +server +location +0.7.8 + + +Preloads an immutable object at configure time. +The name is used a name of the global variable +though which the object is available in njs code. +If the name is not specified, +the file name will be used instead. + +js_preload_object map.json; + +Here, the map is used as a name +while accessing the preloaded object. + + + +Several js_preload_object directives can be specified. + + + + + $variable function | diff --git a/xml/en/docs/stream/ngx_stream_js_module.xml b/xml/en/docs/stream/ngx_stream_js_module.xml --- a/xml/en/docs/stream/ngx_stream_js_module.xml +++ b/xml/en/docs/stream/ngx_stream_js_module.xml @@ -9,7 +9,7 @@ + rev="34">
@@ -471,6 +471,34 @@ since + +name.json | +name from file.json + +stream +server +0.7.8 + + +Preloads an immutable object at configure time. +The name is used a name of the global variable +though which the object is available in njs code. +If the name is not specified, +the file name will be used instead. + +js_preload_object map.json; + +Here, the map is used as a name +while accessing the preloaded object. + + + +Several js_preload_object directives can be specified. + + + + + function | module.function diff --git a/xml/ru/docs/http/ngx_http_js_module.xml b/xml/ru/docs/http/ngx_http_js_module.xml --- a/xml/ru/docs/http/ngx_http_js_module.xml +++ b/xml/ru/docs/http/ngx_http_js_module.xml @@ -9,7 +9,7 @@ + rev="37">
@@ -540,6 +540,35 @@ function version(r) { + +имя.json | +имя from файл.json + +http +server +location +0.7.8 + + +Предварительно загружает неизменяемый объект во время конфигурации. +Имя используется в качестве имени глобальной переменной, +через которую объект доступен в коде njs. +Если имя не указано, +то будет использоваться имя файла. + +js_preload_object map.json; + +В примере map используется в качестве имени +во время доступа к предварительно загруженному объекту. + + + +Директив js_preload_object может быть несколько. + + + + + $переменная функция | diff --git a/xml/ru/docs/stream/ngx_stream_js_module.xml b/xml/ru/docs/stream/ngx_stream_js_module.xml --- a/xml/ru/docs/stream/ngx_stream_js_module.xml +++ b/xml/ru/docs/stream/ngx_stream_js_module.xml @@ -9,7 +9,7 @@ + rev="34">
@@ -450,6 +450,34 @@ function address(s) { + +имя.json | +имя from файл.json + +stream +server +0.7.8 + + +Предварительно загружает неизменяемый объект во время конфигурации. +Имя используется в качестве имени глобальной переменной, +через которую объект доступен в коде njs. +Если имя не указано, +то будет использоваться имя файла. + +js_preload_object map.json; + +В примере map используется в качестве имени +во время доступа к предварительно загруженному объекту. + + + +Директив js_preload_object может быть несколько. + + + + + функция | модуль.функция