From efd9a345c191aa9f97273e270710539b59698ec5 Mon Sep 17 00:00:00 2001 From: Siddharth Jadhav Date: Fri, 19 Apr 2019 12:59:52 +0530 Subject: [PATCH 1/2] Update ___.js Corrected syntax to fetch header values --- templates/express-server/src/api/routes/___.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/express-server/src/api/routes/___.js b/templates/express-server/src/api/routes/___.js index 2aa807f..131f162 100644 --- a/templates/express-server/src/api/routes/___.js +++ b/templates/express-server/src/api/routes/___.js @@ -24,7 +24,7 @@ router.{{@key}}('{{../../subresource}}', async (req, res, next) => { {{{quote ../name}}}: req.params['{{../name}}']{{#unless @last}},{{/unless}} {{/equal}} {{#equal this.in "header"}} - {{{quote ../name}}}: req.header['{{../name}}']{{#unless @last}},{{/unless}} + {{{quote ../name}}}: req.headers['{{../name}}']{{#unless @last}},{{/unless}} {{/equal}} {{#match @../key "(post|put)"}} {{#equal ../in "body"}} From f45c6cc693641f2cd832dd1ea0ea62f86931c71a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=20M=C3=A9ndez?= Date: Wed, 24 Apr 2019 12:11:00 +0530 Subject: [PATCH 2/2] Update templates/express-server/src/api/routes/___.js Co-Authored-By: imSidJ --- templates/express-server/src/api/routes/___.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/express-server/src/api/routes/___.js b/templates/express-server/src/api/routes/___.js index 131f162..7744281 100644 --- a/templates/express-server/src/api/routes/___.js +++ b/templates/express-server/src/api/routes/___.js @@ -24,7 +24,7 @@ router.{{@key}}('{{../../subresource}}', async (req, res, next) => { {{{quote ../name}}}: req.params['{{../name}}']{{#unless @last}},{{/unless}} {{/equal}} {{#equal this.in "header"}} - {{{quote ../name}}}: req.headers['{{../name}}']{{#unless @last}},{{/unless}} +{{{quote ../name}}}: req.get('{{../name}}'){{#unless @last}},{{/unless}} {{/equal}} {{#match @../key "(post|put)"}} {{#equal ../in "body"}}