1- const fs = require ( 'fs' ) ;
21const path = require ( 'path' ) ;
32const express = require ( 'express' ) ;
43const bodyParser = require ( 'body-parser' ) ;
@@ -12,14 +11,16 @@ const opn = require('opn');
1211const app = express ( ) ;
1312const compiler = webpack ( config ) ;
1413
15- app . use ( devMiddleware ( compiler , {
16- logLevel : 'warn' ,
17- publicPath : config . output . publicPath ,
18- watchOptions : {
19- aggregateTimeout : 300 ,
20- poll : true
21- }
22- } ) ) ;
14+ app . use (
15+ devMiddleware ( compiler , {
16+ logLevel : 'warn' ,
17+ publicPath : config . output . publicPath ,
18+ watchOptions : {
19+ aggregateTimeout : 300 ,
20+ poll : true ,
21+ } ,
22+ } )
23+ ) ;
2324app . use ( hotMiddleware ( compiler ) ) ;
2425
2526app . use ( bodyParser . json ( ) ) ; // for parsing application/json
@@ -30,18 +31,23 @@ app.use('/assets', express.static(path.resolve(__dirname, 'assets')));
3031app . use ( '/core' , express . static ( path . resolve ( __dirname , 'lib/core' ) ) ) ;
3132
3233app . get ( '/' , ( req , res ) => {
33- res . sendFile ( path . resolve ( __dirname , 'src/index.html' ) ) ;
34+ res . sendFile ( path . resolve ( __dirname , 'src/index.html' ) ) ;
3435} ) ;
3536
3637app . get ( '/sample-url' , ( req , res ) => {
37- res . redirect ( `/#d=https://pdftron.s3.amazonaws.com/downloads/pl/demo-annotated.pdf&a=1` ) ;
38+ res . redirect (
39+ `/#d=https://pdftron.s3.amazonaws.com/downloads/pl/demo-annotated.pdf&a=1`
40+ ) ;
3841} ) ;
3942
4043app . listen ( 3000 , '0.0.0.0' , err => {
41- if ( err ) {
42- console . error ( err ) ;
43- } else {
44- console . info ( `Listening at localhost:3000 (http://${ ip . address ( ) } :3000)` ) ;
45- opn ( 'http://localhost:3000/#d=https://pdftron.s3.amazonaws.com/downloads/pl/demo-annotated.pdf&a=1' ) ;
46- }
47- } ) ;
44+ if ( err ) {
45+ console . error ( err ) ;
46+ } else {
47+ // eslint-disable-next-line
48+ console . info ( `Listening at localhost:3000 (http://${ ip . address ( ) } :3000)` ) ;
49+ opn (
50+ 'http://localhost:3000/#d=https://pdftron.s3.amazonaws.com/downloads/pl/demo-annotated.pdf&a=1'
51+ ) ;
52+ }
53+ } ) ;
0 commit comments