File tree 4 files changed +20
-3
lines changed
4 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 1
- web : npm install && npm start
1
+ web : npm start
Original file line number Diff line number Diff line change 4
4
"license" : " MIT" ,
5
5
"scripts" : {
6
6
"ng" : " ng" ,
7
- "start" : " ng serve " ,
7
+ "start" : " node www.js " ,
8
8
"build" : " ng build" ,
9
9
"test" : " ng test" ,
10
10
"lint" : " ng lint" ,
11
- "e2e" : " ng e2e"
11
+ "e2e" : " ng e2e" ,
12
+ "postinstall" : " ng build"
12
13
},
13
14
"private" : true ,
14
15
"dependencies" : {
21
22
"@angular/platform-browser-dynamic" : " ^4.0.0" ,
22
23
"@angular/router" : " ^4.0.0" ,
23
24
"core-js" : " ^2.4.1" ,
25
+ "express" : " 4.15.2" ,
24
26
"rxjs" : " ^5.1.0" ,
25
27
"zone.js" : " ^0.8.4"
26
28
},
Original file line number Diff line number Diff line change
1
+ const express = require ( 'express' ) ;
2
+ const path = require ( 'path' ) ;
3
+ const app = express ( ) ;
4
+ // Run the app by serving the static files
5
+ // in the dist directory
6
+ app . use ( express . static ( __dirname + '/dist' ) ) ;
7
+ // Start the app by listening on the default
8
+ // Heroku port
9
+ app . listen ( process . env . PORT || 8080 ) ;
10
+
11
+ // For all GET requests, send back index.html
12
+ // so that PathLocationStrategy can be used
13
+ app . get ( '/*' , function ( req , res ) {
14
+ res . sendFile ( path . join ( __dirname + '/dist/index.html' ) ) ;
15
+ } ) ;
You can’t perform that action at this time.
0 commit comments