1
- const express = require ( 'express' ) ;
1
+ import express from 'express' ;
2
2
const app = express ( ) ;
3
3
4
4
@@ -12,7 +12,7 @@ const app = express();
12
12
************************************************************/
13
13
14
14
// Serve application file depending on environment
15
- app . get ( '/app.js' , function ( req , res ) {
15
+ app . get ( '/app.js' , ( req , res ) => {
16
16
if ( process . env . PRODUCTION ) {
17
17
res . sendFile ( __dirname + '/build/app.js' ) ;
18
18
} else {
@@ -21,7 +21,7 @@ app.get('/app.js', function(req, res) {
21
21
} ) ;
22
22
23
23
// Serve aggregate stylesheet depending on environment
24
- app . get ( '/style.css' , function ( req , res ) {
24
+ app . get ( '/style.css' , ( req , res ) => {
25
25
if ( process . env . PRODUCTION ) {
26
26
res . sendFile ( __dirname + '/build/style.css' ) ;
27
27
} else {
@@ -30,7 +30,7 @@ app.get('/style.css', function(req, res) {
30
30
} ) ;
31
31
32
32
// Serve index page
33
- app . get ( '*' , function ( req , res ) {
33
+ app . get ( '*' , ( req , res ) => {
34
34
res . sendFile ( __dirname + '/build/index.html' ) ;
35
35
} ) ;
36
36
@@ -53,7 +53,7 @@ if (!process.env.PRODUCTION) {
53
53
hot : true ,
54
54
noInfo : true ,
55
55
historyApiFallback : true
56
- } ) . listen ( 9090 , 'localhost' , function ( err , result ) {
56
+ } ) . listen ( 9090 , 'localhost' , ( err , result ) => {
57
57
if ( err ) {
58
58
console . log ( err ) ;
59
59
}
@@ -68,7 +68,7 @@ if (!process.env.PRODUCTION) {
68
68
*****************/
69
69
70
70
const port = process . env . PORT || 8080 ;
71
- const server = app . listen ( port , function ( ) {
71
+ const server = app . listen ( port , ( ) => {
72
72
const host = server . address ( ) . address ;
73
73
const port = server . address ( ) . port ;
74
74
0 commit comments