@@ -2,7 +2,7 @@ var http = require('http');
22
33var express = require ( 'express' ) ;
44
5- require ( 'console-stamp' ) ( console , " HH:MM:ss.l" ) ;
5+ require ( 'console-stamp' ) ( console , ' HH:MM:ss.l' ) ;
66
77var app = express ( ) ;
88
@@ -11,36 +11,44 @@ app.use(require('morgan')('short'));
1111// ************************************
1212// This is the real meat of the example
1313// ************************************
14- ( function ( ) {
15-
14+ ( function ( ) {
1615 // Step 1: Create & configure a webpack compiler
1716 var webpack = require ( 'webpack' ) ;
18- var webpackConfig = require ( process . env . WEBPACK_CONFIG ? process . env . WEBPACK_CONFIG : './webpack.config' ) ;
17+ var webpackConfig = require ( process . env . WEBPACK_CONFIG
18+ ? process . env . WEBPACK_CONFIG
19+ : './webpack.config' ) ;
1920 var compiler = webpack ( webpackConfig ) ;
2021
2122 // Step 2: Attach the dev middleware to the compiler & the server
22- app . use ( require ( "webpack-dev-middleware" ) ( compiler , {
23- logLevel : 'warn' , publicPath : webpackConfig . output . publicPath
24- } ) ) ;
23+ app . use (
24+ require ( 'webpack-dev-middleware' ) ( compiler , {
25+ logLevel : 'warn' ,
26+ publicPath : webpackConfig . output . publicPath ,
27+ } )
28+ ) ;
2529
2630 // Step 3: Attach the hot middleware to the compiler & the server
27- app . use ( require ( "webpack-hot-middleware" ) ( compiler , {
28- log : console . log , path : '/__webpack_hmr' , heartbeat : 10 * 1000
29- } ) ) ;
31+ app . use (
32+ require ( 'webpack-hot-middleware' ) ( compiler , {
33+ log : console . log ,
34+ path : '/__webpack_hmr' ,
35+ heartbeat : 10 * 1000 ,
36+ } )
37+ ) ;
3038} ) ( ) ;
3139
3240// Do anything you like with the rest of your express application.
3341
34- app . get ( "/" , function ( req , res ) {
42+ app . get ( '/' , function ( req , res ) {
3543 res . sendFile ( __dirname + '/index.html' ) ;
3644} ) ;
37- app . get ( " /multientry" , function ( req , res ) {
45+ app . get ( ' /multientry' , function ( req , res ) {
3846 res . sendFile ( __dirname + '/index-multientry.html' ) ;
3947} ) ;
4048
4149if ( require . main === module ) {
4250 var server = http . createServer ( app ) ;
43- server . listen ( process . env . PORT || 1616 , function ( ) {
44- console . log ( " Listening on %j" , server . address ( ) ) ;
51+ server . listen ( process . env . PORT || 1616 , function ( ) {
52+ console . log ( ' Listening on %j' , server . address ( ) ) ;
4553 } ) ;
4654}
0 commit comments