@@ -18,65 +18,22 @@ app.use(cors());
18
18
// });
19
19
20
20
// Define routes for each backend service for local development
21
- // app.use('/questionservice', (req, res) => {
22
- // proxy.web(req, res, { target: 'http://localhost:3002' });
23
- // });
24
-
25
- // app.use('/authservice', (req, res) => {
26
- // proxy.web(req, res, { target: 'http://localhost:3003' });
27
- // });
28
-
29
- // app.use('/userservice', (req, res) => {
30
- // proxy.web(req, res, { target: 'http://localhost:3004' });
31
- // });
32
-
33
- // app.use('/matchingservice', (req, res) => {
34
- // proxy.web(req, res, { target: 'http://localhost:3005' });
35
- // });
36
-
37
- //Define routes for each backend service for production/docker containers
38
21
app . use ( "/questionservice" , ( req , res ) => {
39
- proxy . web ( req , res , { target : "http://localhost:3002" } ) ;
40
- //http://question-service:3002
41
- //http://localhost:3002
22
+ proxy . web ( req , res , { target : "http://question-service:3002" } ) ;
42
23
} ) ;
43
24
44
25
app . use ( "/authservice" , ( req , res ) => {
45
- proxy . web ( req , res , { target : "http://localhost:3003" } ) ;
46
- //http://auth-service:3003
47
- //http://localhost:3003
26
+ proxy . web ( req , res , { target : "http://auth-service:3003" } ) ;
48
27
} ) ;
49
28
50
29
app . use ( "/userservice" , ( req , res ) => {
51
- proxy . web ( req , res , { target : "http://localhost:3004" } ) ;
52
- // http://user-service:3004
53
- //http://localhost:3004
30
+ proxy . web ( req , res , { target : "http://user-service:3004" } ) ;
54
31
} ) ;
55
32
56
33
app . use ( "/matchingservice" , ( req , res ) => {
57
- proxy . web ( req , res , { target : "http://localhost:3005" } ) ;
58
- //http://matching-service:3005
59
- //http://localhost:3005
34
+ proxy . web ( req , res , { target : "http://matching-service:3005" } ) ;
60
35
} ) ;
61
36
62
- //Define routes for each backend service for production/docker containers
63
- // app.use("/questionservice", (req, res) => {
64
- // proxy.web(req, res, { target: "http://question-service:3002" });
65
- // });
66
-
67
- // app.use("/authservice", (req, res) => {
68
- // proxy.web(req, res, { target: "http://auth-service:3003" });
69
- // });
70
-
71
- // app.use("/userservice", (req, res) => {
72
- // proxy.web(req, res, { target: "http://user-service:3004" });
73
- // });
74
-
75
- // app.use("/matchingservice", (req, res) => {
76
- // proxy.web(req, res, { target: "http://matching-service:3005" });
77
- // });
78
-
79
-
80
37
// Start the server
81
38
app . listen ( 3001 , ( ) => {
82
39
console . log ( "API Gateway listening on port 3001" ) ;
0 commit comments