From b81f45b5162fd82832d3330fff997add2044c9f2 Mon Sep 17 00:00:00 2001 From: uo277310 Date: Wed, 1 May 2024 14:36:47 +0200 Subject: [PATCH] Arreglo hospot --- gatewayservice/.env | 1 + gatewayservice/gateway-service.js | 4 +++- gatewayservice/package-lock.json | 12 ++++++++++++ gatewayservice/package.json | 1 + 4 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 gatewayservice/.env diff --git a/gatewayservice/.env b/gatewayservice/.env new file mode 100644 index 00000000..1b062ab6 --- /dev/null +++ b/gatewayservice/.env @@ -0,0 +1 @@ +PROD_URL=http://51.142.17.139/ \ No newline at end of file diff --git a/gatewayservice/gateway-service.js b/gatewayservice/gateway-service.js index 1b1d20f2..785265b2 100644 --- a/gatewayservice/gateway-service.js +++ b/gatewayservice/gateway-service.js @@ -7,6 +7,8 @@ const swaggerUi = require('swagger-ui-express'); const fs = require("fs") const YAML = require('yaml') +require('dotenv').config(); + const app = express(); app.disable("x-powered-by"); const port = 8000; @@ -20,7 +22,7 @@ const rankingServiceUrl = process.env.RANK_SERVICE_URL || 'http://localhost:8004 const questiongeneratorserviceUrl = process.env.QTEST_SERVICE_URL || 'http://localhost:8007'; const devUrl = process.env.DEV_URL || 'http://localhost'; -const prodUrl = process.env.PROD_URL || 'http://51.142.17.139'; +const prodUrl = process.env.PROD_URL; const corsOptions = { origin: [devUrl, prodUrl], diff --git a/gatewayservice/package-lock.json b/gatewayservice/package-lock.json index 5b0ae06e..bb994988 100644 --- a/gatewayservice/package-lock.json +++ b/gatewayservice/package-lock.json @@ -11,6 +11,7 @@ "dependencies": { "axios": "^1.6.5", "cors": "^2.8.5", + "dotenv": "^16.4.5", "express": "^4.18.2", "express-openapi": "^12.1.3", "express-prom-bundle": "^7.0.0", @@ -1980,6 +1981,17 @@ "esprima": "^4.0.0" } }, + "node_modules/dotenv": { + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://dotenvx.com" + } + }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", diff --git a/gatewayservice/package.json b/gatewayservice/package.json index 077bed11..8eb6c77b 100644 --- a/gatewayservice/package.json +++ b/gatewayservice/package.json @@ -20,6 +20,7 @@ "dependencies": { "axios": "^1.6.5", "cors": "^2.8.5", + "dotenv": "^16.4.5", "express": "^4.18.2", "express-openapi": "^12.1.3", "express-prom-bundle": "^7.0.0",