File tree 3 files changed +20
-2
lines changed
3 files changed +20
-2
lines changed Original file line number Diff line number Diff line change 6
6
< body >
7
7
< div id ="root ">
8
8
</ div >
9
- < script src ="dist/ bundle.js "> </ script >
9
+ < script src ="bundle.js "> </ script >
10
10
</ body >
11
11
</ html >
Original file line number Diff line number Diff line change 14
14
},
15
15
"homepage" : " https://github.com/ramesaliyev/ej-react-workshop#readme" ,
16
16
"scripts" : {
17
- "build" : " webpack"
17
+ "build" : " webpack" ,
18
+ "server" : " node server" ,
19
+ "start" : " npm run build && npm run server"
18
20
},
19
21
"dependencies" : {
22
+ "express" : " ^4.15.2" ,
20
23
"webpack" : " ^2.5.0"
21
24
}
22
25
}
Original file line number Diff line number Diff line change
1
+ const path = require ( 'path' ) ;
2
+ const Express = require ( 'express' ) ;
3
+
4
+ const app = new Express ( ) ;
5
+ const port = 3000 ;
6
+
7
+ app . use ( Express . static ( 'dist' ) )
8
+
9
+ app . get ( '/' , ( req , res ) => {
10
+ res . sendFile ( path . join ( __dirname , 'index.html' ) ) ;
11
+ } ) ;
12
+
13
+ app . listen ( port , ( ) => {
14
+ console . log ( 'Server working on http://localhost:' + port ) ;
15
+ } ) ;
You can’t perform that action at this time.
0 commit comments