Skip to content

Commit cfd4461

Browse files
committed
replace API_BASE_URL
1 parent c9a712b commit cfd4461

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

app/src/serverConfig.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ const isProduction = process.env.NODE_ENV === 'production';
22
const serverConfig = {
33
DEV_PORT: 5656,
44
API_BASE_URL: isProduction
5-
? 'https://app.reactype.dev'
5+
? 'https://reactype-2c81e4204f81.herokuapp.com'
66
: 'http://localhost:5656',
77
// : 'http://localhost:8080',
88
API_BASE_URL2: isProduction
9-
? 'https://app.reactype.dev'
9+
? 'https://reactype-2c81e4204f81.herokuapp.com'
1010
: 'http://localhost:8080'
1111
};
1212
// module.exports = config;

config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ const isProduction = process.env.NODE_ENV === 'production';
22
const config = {
33
DEV_PORT: 5656,
44
API_BASE_URL: isProduction
5-
? 'https://app.reactype.dev'
5+
? 'https://reactype-2c81e4204f81.herokuapp.com'
66
: 'http://localhost:5656',
77
// : 'http://localhost:8080',
88
API_BASE_URL2: isProduction
9-
? 'https://app.reactype.dev'
9+
? 'https://reactype-2c81e4204f81.herokuapp.com'
1010
: 'http://localhost:8080'
1111
};
1212
module.exports = config;

server/server.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ app.use(
5151

5252
//if in production mode, statically serve everything in the build folder on the route '/dist'
5353
if (process.env.NODE_ENV == 'production') {
54+
console.log('currently in port', process.env.PORT);
5455
console.log('in production');
5556
console.log('joined path: ', path.join(__dirname, '../build'));
5657
app.use('/', express.static(path.join(__dirname, '../build')));
5758
} else {
5859
console.log('not production');
59-
console.log('joined path: ', path.join(__dirname, '../build'));
6060
app.get('/', (req, res) => {
6161
const indexPath = path.join(__dirname, '../index.html');
6262
return res.status(200).sendFile(indexPath);
@@ -89,7 +89,12 @@ const httpServer = createServer(app);
8989
const io = new Server(httpServer, {
9090
transports: ['websocket'],
9191
cors: {
92-
origin: ['http://localhost:5656', 'http://localhost:8080', API_BASE_URL]
92+
origin: [
93+
process.env.PORT,
94+
'http://localhost:5656',
95+
'http://localhost:8080',
96+
API_BASE_URL
97+
]
9398
}
9499
});
95100

0 commit comments

Comments
 (0)