forked from Automattic/wp-calypso
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
27 lines (23 loc) · 626 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
27
/**
* External dependencies.
*/
var boot = require( 'boot' ),
http = require( 'http' );
/**
* Internal dependencies
*/
var pkg = require( './package.json' ),
config = require( 'config' );
var start = Date.now(),
port = process.env.PORT || 3000,
app = boot(),
server,
hotReloader;
console.log( '%s booted in %dms - port: %s', pkg.name, ( Date.now() ) - start, port );
server = http.createServer( app );
server.listen( port );
// Enable hot reloader in development
if ( config( 'env' ) === 'development' ) {
hotReloader = require( 'bundler/hot-reloader' );
hotReloader.listen( server, app.get( 'compiler' ) );
}