File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 2
2
< html lang ="en ">
3
3
< head >
4
4
< meta charset ="utf-8 " />
5
- < title > React Boilerplate </ title >
5
+ < title > Code Quizz </ title >
6
6
</ head >
7
7
< body >
8
8
< div id ="app "> </ div >
Original file line number Diff line number Diff line change 7
7
"author" : " gitconnected team" ,
8
8
"license" : " MIT" ,
9
9
"scripts" : {
10
+ "start" : " node server.js" ,
10
11
"build" : " webpack" ,
11
12
"dev" : " webpack-dev-server" ,
12
13
"lint" : " eslint src -c .eslintrc.json --ext js,jsx" ,
15
16
"dependencies" : {
16
17
"bootstrap" : " ^4.3.1" ,
17
18
"css-loader" : " ^3.2.0" ,
19
+ "express" : " ^4.17.1" ,
18
20
"json-loader" : " ^0.5.7" ,
19
21
"prismjs" : " ^1.17.1" ,
20
22
"react" : " ^16.10.1" ,
Original file line number Diff line number Diff line change
1
+ const express = require ( 'express' ) ;
2
+ const path = require ( 'path' ) ;
3
+
4
+ const app = express ( ) ;
5
+
6
+ app . use ( '/dist' , express . static ( path . resolve ( __dirname , 'dist' ) ) ) ;
7
+
8
+ app . use ( '*' , ( req , res ) => {
9
+ res . sendFile ( path . join ( __dirname , 'index.html' ) ) ;
10
+ } ) ;
11
+
12
+ const port = process . env . PORT || 3000 ;
13
+ app . listen ( port , ( ) => {
14
+ console . log ( `serving on port ${ port } ` ) ;
15
+ } ) ;
You can’t perform that action at this time.
0 commit comments