changeset 2489:bda080989b6c

Fixed indentation and braces in njs example.
author Vladimir Homutov <vl@nginx.com>
date Wed, 22 Jan 2020 13:10:07 +0300
parents 6ff92c65df94
children b6f9da728570
files xml/en/docs/njs/node_modules.xml
diffstat 1 files changed, 12 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/xml/en/docs/njs/node_modules.xml
+++ b/xml/en/docs/njs/node_modules.xml
@@ -412,6 +412,7 @@ function parse_msg(pb, msg)
     var response = pb.helloworld.HelloReply.decode(bytes);
 
     console.log('Reply is:' + response.message);
+}
 </example>
 </para>
 
@@ -497,18 +498,18 @@ that stores our code:
 <example>
 function set_buffer(dnsPacket)
 {
-// create DNS packet bytes
-var buf = dnsPacket.encode({
-    type: 'query',
-    id: 1,
-    flags: dnsPacket.RECURSION_DESIRED,
-    questions: [{
-        type: 'A',
-        name: 'google.com'
-    }]
-})
+    // create DNS packet bytes
+    var buf = dnsPacket.encode({
+        type: 'query',
+        id: 1,
+        flags: dnsPacket.RECURSION_DESIRED,
+        questions: [{
+            type: 'A',
+            name: 'google.com'
+        }]
+    })
 
-return buf;
+    return buf;
 }
 </example>