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)) {