From 3e8fc9d3abc5acbe89e8789875b0d950f221b609 Mon Sep 17 00:00:00 2001 From: baraganio Date: Sun, 28 Apr 2024 19:22:53 +0200 Subject: [PATCH] Cambiando random por crypto e intentando solucionar problema del cors --- gatewayservice/Dockerfile | 3 +++ questions/creationservice/creation-service.js | 10 +++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gatewayservice/Dockerfile b/gatewayservice/Dockerfile index 7c030c37..f349f043 100644 --- a/gatewayservice/Dockerfile +++ b/gatewayservice/Dockerfile @@ -13,5 +13,8 @@ RUN npm install --ignore-scripts # Copy the app source code to the working directory COPY . . +ARG API_ORIGIN_URI="http://localhost:3000" +ENV REACT_APP_API_ORIGIN_ENDPOINT=$API_ORIGIN_URI + # Define the command to run your app CMD ["node", "gateway-service.js"] diff --git a/questions/creationservice/creation-service.js b/questions/creationservice/creation-service.js index b67b2a5d..e14b3e5f 100644 --- a/questions/creationservice/creation-service.js +++ b/questions/creationservice/creation-service.js @@ -1,6 +1,7 @@ const express = require('express'); const mongoose = require('mongoose'); const fetch = require('node-fetch'); +const crypto = require('crypto'); const Question = require('./creation-model'); const app = express(); @@ -37,7 +38,8 @@ function getQuestionInfo(info){ // Select 4 random rows of the data for (let i = 0; i