Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Arquisoft/wiq_es1a
Browse files Browse the repository at this point in the history
  • Loading branch information
iyanfdezz committed Apr 2, 2024
2 parents c86d842 + 608015d commit 7bb11d0
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion users/userservice/user-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,20 @@ const app = express();
const port = 8001;

const cors = require('cors');
app.use(cors());

const corsOptions = {
origin: [
process.env.AUTH_SERVICE_URL || "http://localhost:8000",
process.env.USER_SERVICE_URL || "http://localhost:8001",
process.env.QUESTION_SERVICE_URL || "http://localhost:8002",
process.env.STATS_SERVICE_URL || "http://localhost:8003",
process.env.GATEWAY_SERVICE_URL || "http://localhost:8004",
process.env.MONGODB_URI || "mongodb://localhost:27017/userdb",
process.env.MONGODB_STATS_URI || "mongodb://localhost:27017/statsdb"
],
};

app.use(cors(corsOptions));

// Middleware to parse JSON in request body
app.use(bodyParser.json());
Expand Down

0 comments on commit 7bb11d0

Please sign in to comment.