-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.js
58 lines (52 loc) · 1.44 KB
/
run.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
const server = require('./src/backend/server');
const port = (process.env.PORT || 3000);
server.listen(port);
console.log(`Listening at http://localhost:${port}`);
console.log(`RUNNIN JS DEV SERVER ${process.env.NODE_ENV}`);
//DATABASE_URL=$(heroku config:get DATABASE_URL -a afternoon-citadel-52337) npm start
if (process.env.NODE_ENV !== 'production') {
var config = require('./webpack.dev.config');
var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
new WebpackDevServer(webpack(config), {
publicPath: "/bin/",
hot: true,
inline: true,
proxy: {
'/socket.io': {
target: 'http://localhost:3000',
secure: false
},
'/signup': {
target: 'http://localhost:3000',
secure: false
},
'/login': {
target: 'http://localhost:3000',
secure: false
},
'/logout': {
target: 'http://localhost:3000',
secure: false
},
'/whoami': {
target: 'http://localhost:3000',
secure: false
},
'/room/**': {
target: 'http://localhost:3000',
secure: false
},
'/tempUserInfo': {
target: 'http://localhost:3000',
secure: false
}
},
historyApiFallback: true
}).listen(3001, 'localhost', (err, result) => {
if (err) {
return console.log(err);
}
console.log('Dev Server listening at http://localhost:3001/');
});
}