diff --git a/lib/serve.js b/lib/serve.js index 6429442..e6a4d8e 100644 --- a/lib/serve.js +++ b/lib/serve.js @@ -42,14 +42,14 @@ module.exports = { for (let funcConf of funcConfs) { for (let httpEvent of funcConf.events) { const method = httpEvent.method.toLowerCase(); - const endpoint = `/${httpEvent.path}`; + const endpoint = `/${this.options.stage}/${httpEvent.path}`; const path = endpoint.replace(/\{(.+?)\}/g, ':$1'); let handler = this._handerBase(funcConf.id); if (httpEvent.cors) { handler = this._handlerAddCors(handler); } app[method]( - path, // TODO add env prefix + path, handler ); console.log(` ${method.toUpperCase()} - http://localhost:${this._getPort()}${endpoint}`);