mongoose-auto-api.consumer
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -1,2 +0,2 @@ | ||
var ACCESS_TOKEN, PASSWORD1, PASSWORD2, SECRET_KEY, USERNAME, assert, c, consumer, customerModel, fs, infoModel, lineBreak, models, okayAssert, okayExistsAssert, productModel, should, url; | ||
var ACCESS_TOKEN, PASSWORD1, PASSWORD2, SECRET_KEY, USERNAME, assert, c, consumer, customerModel, fs, host, infoModel, lineBreak, models, okayAssert, okayExistsAssert, productModel, should, url; | ||
@@ -13,2 +13,4 @@ fs = require('fs'); | ||
host = 'localhost'; | ||
url = ''; | ||
@@ -52,3 +54,4 @@ | ||
api = require('mongoose-auto-api.rest'); | ||
url = `http://localhost:${api.config.serverPort}`; | ||
host = api.config.serverAddress; | ||
url = `http://${host}:${api.config.serverPort}`; | ||
return done(); | ||
@@ -350,3 +353,3 @@ }); | ||
return it('Correct URL', function() { | ||
return assert.equal(c.url, "http://localhost:5000"); | ||
return assert.equal(c.url, `http://${host}:5000`); | ||
}); | ||
@@ -353,0 +356,0 @@ }); |
@@ -18,3 +18,3 @@ var Controller, a, collectionReq, deleteReq, error, getReq, postReq, request, serverConfig, url, urlStr; | ||
url = `http://localhost:${serverConfig.serverPort}`; | ||
url = `http://${serverConfig.serverAddress}:${serverConfig.serverPort}`; | ||
@@ -97,3 +97,3 @@ //::: HELPERS ::: | ||
this.port = Number(args.port); | ||
url = `http://localhost:${this.port}`; | ||
url = `http://${serverConfig.serverAddress}:${this.port}`; | ||
} else { | ||
@@ -109,3 +109,3 @@ this.port = serverConfig.serverPort; | ||
this.port = Number(port); | ||
url = `http://localhost:${this.port}`; | ||
url = `http://${serverConfig.serverAddress}:${this.port}`; | ||
this.url = url; | ||
@@ -112,0 +112,0 @@ return true; |
{ | ||
"name": "mongoose-auto-api.consumer", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Automatic Mongoose REST API - API Consumption Module", | ||
@@ -45,4 +45,4 @@ "main": "./js/index.js", | ||
"mocha": "*", | ||
"mongoose-auto-api.rest": "^0.1.4" | ||
"mongoose-auto-api.rest": "^0.1.6" | ||
} | ||
} |
17888
521