From 377327b3214e6d70cf0da58c24cbaf81ef7c8365 Mon Sep 17 00:00:00 2001 From: Kamil Burzynski Date: Fri, 2 Oct 2015 17:46:34 +0200 Subject: [PATCH] Added stage name to API name --- lib/commands/deploy_endpoint.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/commands/deploy_endpoint.js b/lib/commands/deploy_endpoint.js index 22fa6c0fa..f8e263bdd 100644 --- a/lib/commands/deploy_endpoint.js +++ b/lib/commands/deploy_endpoint.js @@ -398,8 +398,12 @@ ApiDeployer.prototype._findOrCreateApi = Promise.method(function() { } else { // Create REST API + + var apiName = _this._prjJson.name + '-' + _this._stage; + apiName = apiName.substr( 0, 1023 ); // keep the name length below the limits + return _this.ApiClient.createRestApi({ - name: _this._prjJson.name, + name: apiName, description: _this._prjJson.description ? _this._prjJson.description : 'A REST API for a JAWS project.', }).then(function(response) {