From df2f460b18ed182ab488b55be14f57afd23ee835 Mon Sep 17 00:00:00 2001 From: patrickheeney Date: Sun, 3 Sep 2017 17:19:44 -0700 Subject: [PATCH] Fix default response template --- src/Endpoint.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Endpoint.js b/src/Endpoint.js index 874d819b9..167b4da7e 100644 --- a/src/Endpoint.js +++ b/src/Endpoint.js @@ -62,9 +62,9 @@ class Endpoint { // determine response template const resFilename = `${this.options.handlerPath}.res.vm`; fep.responseContentType = this.getResponseContentType(fep); - debugLog('Response Content-Type ', this.responseContentType); + debugLog('Response Content-Type ', fep.responseContentType); // load response template from http response template, or load file if exists other use default - if (fep.response.template) { + if (fep.response && fep.response.template) { fep.responses.default.responseTemplates[fep.responseContentType] = fep.response.template; } else if (fs.existsSync(resFilename)) {