From a1a0563a5c6070febce419ef13834d3dbd562a45 Mon Sep 17 00:00:00 2001 From: aviadsteps <45530930+aviadsteps@users.noreply.github.com> Date: Sun, 24 Nov 2019 12:51:46 +0200 Subject: [PATCH 1/2] Update index.js --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index e8a2b9c..ced922b 100644 --- a/src/index.js +++ b/src/index.js @@ -46,7 +46,7 @@ class LambdaOffline { const funOptionsCache = Object.keys(this.service.functions).reduce((acc, key) => { const fun = this.service.getFunction(key); - acc[key] = functionHelper.getFunctionOptions(fun, key, servicePath, serviceRuntime); + acc[fun.name] = functionHelper.getFunctionOptions(fun, key, servicePath, serviceRuntime); return acc; }, {}); From 0b091685ecac365655da44128ad37ecd1dbe0c17 Mon Sep 17 00:00:00 2001 From: aviadsteps <45530930+aviadsteps@users.noreply.github.com> Date: Sun, 24 Nov 2019 13:59:04 +0200 Subject: [PATCH 2/2] Fixes to make file same as in working package --- src/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index ced922b..7349fde 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,3 @@ -const path = require('path'); const Hapi = require('hapi'); const functionHelper = require('serverless-offline/src/functionHelper'); @@ -41,7 +40,7 @@ class LambdaOffline { this.server = new Hapi.Server(); this.server.connection({ port: this.config.port, host: this.config.host }); - const servicePath = path.join(this.serverless.config.servicePath, this.options.location); + const { servicePath } = this.serverless.config; const serviceRuntime = this.service.provider.runtime; const funOptionsCache = Object.keys(this.service.functions).reduce((acc, key) => {