Skip to content

Commit 10faffd

Browse files
authored
Fix broken sample app (#6)
* updated port to be correct for the server * Fixed duplicate proxy parameter issue
1 parent bb21c38 commit 10faffd

2 files changed

Lines changed: 9 additions & 19 deletions

File tree

client/src/setupProxy.js

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
11
const { createProxyMiddleware } = require('http-proxy-middleware');
22

3-
module.exports = function(app, host = 'local') {
4-
if (host == 'local') {
5-
app.use(
6-
'/api',
7-
createProxyMiddleware({
8-
target: 'http://local:3001',
9-
changeOrigin: true,
10-
})
11-
);
12-
} else {
13-
app.use(
14-
'/api',
15-
createProxyMiddleware({
16-
target: 'http://server:3001',
17-
changeOrigin: true,
18-
})
19-
);
20-
}
3+
module.exports = function(app) {
4+
app.use(
5+
'/api',
6+
createProxyMiddleware({
7+
target: 'http://server:3001',
8+
changeOrigin: true,
9+
})
10+
);
2111
};

server/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import logger from '@shared/Logger';
88
* Default values are hard coded here, but you may choose to store these values in a
99
* config file or other mechanism
1010
*/
11-
const port = Number(process.env.PORT || 3000);
11+
const port = Number(process.env.PORT || 3001);
1212
app.listen(port, () => {
1313
logger.info('Express server started on port: ' + port);
1414
});

0 commit comments

Comments
 (0)