-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
26 lines (24 loc) · 978 Bytes
/
index.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
require('babel-register')();
require('babel-polyfill');
/**
* Define universal constants.
*/
global.__CLIENT__ = false;
global.__SERVER__ = true;
if (process.env.NODE_ENV === 'production') {
console.info('Initializing the production server.'); // eslint-disable-line no-console
require('./src/server.js').default((server) => {
server.start(() => {
console.info('==> ✅ Server is listening'); // eslint-disable-line no-console
console.info('==> 🌎 Go to ' + server.info.uri.toLowerCase()); // eslint-disable-line no-console
});
});
} else {
console.info('Initializing the development server. This may take a while...'); // eslint-disable-line no-console
require('./webpack.server.js').default((server) => {
server.start(() => {
console.info('==> ✅ Server is listening'); // eslint-disable-line no-console
console.info('==> 🌎 Go to ' + server.info.uri.toLowerCase()); // eslint-disable-line no-console
});
});
}