forked from microservices-demo/front-end
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathendpoints.js
29 lines (26 loc) · 1000 Bytes
/
endpoints.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
(function (){
'use strict';
var util = require('util');
var domain = "";
process.argv.forEach(function (val, index, array) {
var arg = val.split("=");
if (arg.length > 1) {
if (arg[0] == "--domain") {
domain = "." + arg[1];
console.log("Setting domain to:", domain);
}
}
});
module.exports = {
helloWorldUrl: util.format("http://helloworld%s",domain),
catalogueUrl: util.format("http://catalogue%s", domain),
tagsUrl: util.format("http://catalogue%s/tags", domain),
cartsUrl: util.format("http://carts%s/carts", domain),
ordersUrl: util.format("http://orders%s", domain),
customersUrl: util.format("http://user%s/customers", domain),
addressUrl: util.format("http://user%s/addresses", domain),
cardsUrl: util.format("http://user%s/cards", domain),
loginUrl: util.format("http://user%s/login", domain),
registerUrl: util.format("http://user%s/register", domain),
};
}());