File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -30,19 +30,19 @@ class ExpressHTTPServer {
3030
3131 this . beforeMiddleware ( app ) ;
3232
33+ if ( this . cache ) {
34+ app . get ( '/*' , this . buildCacheMiddleware ( ) ) ;
35+ }
36+
3337 if ( this . gzip ) {
34- this . app . use ( require ( 'compression' ) ( ) ) ;
38+ app . use ( require ( 'compression' ) ( ) ) ;
3539 }
3640
3741 if ( username !== undefined || password !== undefined ) {
3842 this . ui . writeLine ( `adding basic auth; username=${ username } ; password=${ password } ` ) ;
3943 app . use ( basicAuth ( username , password ) ) ;
4044 }
4145
42- if ( this . cache ) {
43- app . get ( '/*' , this . buildCacheMiddleware ( ) ) ;
44- }
45-
4646 if ( this . distPath ) {
4747 app . get ( '/' , fastbootMiddleware ) ;
4848 app . use ( express . static ( this . distPath ) ) ;
@@ -75,12 +75,12 @@ class ExpressHTTPServer {
7575 . then ( response => {
7676 if ( response ) {
7777 this . ui . writeLine ( `cache hit; path=${ path } ` ) ;
78- res . send ( response ) ;
78+ res . body = response ;
7979 } else {
8080 this . ui . writeLine ( `cache miss; path=${ path } ` ) ;
8181 this . interceptResponseCompletion ( path , res ) ;
82- next ( ) ;
8382 }
83+ next ( ) ;
8484 } )
8585 . catch ( ( ) => next ( ) ) ;
8686 } ;
You can’t perform that action at this time.
0 commit comments