|
|
@@ -2,13 +2,11 @@ import fetch from "node-fetch"
|
|
|
import express from "express"
|
|
|
|
|
|
const app = express();
|
|
|
-const port = 3000;
|
|
|
|
|
|
-//TODO load these values from setting or env
|
|
|
-
|
|
|
-const IROHA_API_HOST = "http://localhost";
|
|
|
-const IROHA_API_PORT = 5000;
|
|
|
-const IROHA_DOMAIN = "test";
|
|
|
+const CHAIN4ALL_SERVICE_PORT = process.env.CHAIN4ALL_SERVICE_PORT || 3000;
|
|
|
+const IROHA_API_HOST = process.env.IROHA_API_HOST || "http://localhost";
|
|
|
+const IROHA_API_PORT = process.env.IROHA_API_PORT || 5000;
|
|
|
+const IROHA_DOMAIN = process.env.IROHA_DOMAIN || "test";
|
|
|
|
|
|
app.post("/price", (req, res) => {
|
|
|
//TODO implement price calculation depending on extent area
|
|
|
@@ -71,8 +69,8 @@ app.post("/buy", (req, res) => {
|
|
|
res.status(201);
|
|
|
});
|
|
|
|
|
|
-app.listen(port, () => {
|
|
|
- console.log(`Listening at http://localhost:${port}`)
|
|
|
+app.listen(CHAIN4ALL_SERVICE_PORT, () => {
|
|
|
+ console.log(`Listening at http://localhost:${CHAIN4ALL_SERVICE_PORT}`)
|
|
|
});
|
|
|
|
|
|
async function fetchUsersAssets(userId){
|