File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ if (DEVELOPMENT) {
17
17
const viteDevServer = await import ( "vite" ) . then ( ( vite ) =>
18
18
vite . createServer ( {
19
19
server : { middlewareMode : true } ,
20
- } )
20
+ } ) ,
21
21
) ;
22
22
app . use ( viteDevServer . middlewares ) ;
23
23
app . use ( async ( req , res , next ) => {
@@ -35,14 +35,13 @@ if (DEVELOPMENT) {
35
35
console . log ( "Starting production server" ) ;
36
36
app . use (
37
37
"/assets" ,
38
- express . static ( "build/client/assets" , { immutable : true , maxAge : "1y" } )
38
+ express . static ( "build/client/assets" , { immutable : true , maxAge : "1y" } ) ,
39
39
) ;
40
+ app . use ( morgan ( "tiny" ) ) ;
40
41
app . use ( express . static ( "build/client" , { maxAge : "1h" } ) ) ;
41
42
app . use ( await import ( BUILD_PATH ) . then ( ( mod ) => mod . app ) ) ;
42
43
}
43
44
44
- app . use ( morgan ( "tiny" ) ) ;
45
-
46
45
app . listen ( PORT , ( ) => {
47
46
console . log ( `Server is running on http://localhost:${ PORT } ` ) ;
48
47
} ) ;
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ if (DEVELOPMENT) {
17
17
const viteDevServer = await import ( "vite" ) . then ( ( vite ) =>
18
18
vite . createServer ( {
19
19
server : { middlewareMode : true } ,
20
- } )
20
+ } ) ,
21
21
) ;
22
22
app . use ( viteDevServer . middlewares ) ;
23
23
app . use ( async ( req , res , next ) => {
@@ -35,14 +35,13 @@ if (DEVELOPMENT) {
35
35
console . log ( "Starting production server" ) ;
36
36
app . use (
37
37
"/assets" ,
38
- express . static ( "build/client/assets" , { immutable : true , maxAge : "1y" } )
38
+ express . static ( "build/client/assets" , { immutable : true , maxAge : "1y" } ) ,
39
39
) ;
40
+ app . use ( morgan ( "tiny" ) ) ;
40
41
app . use ( express . static ( "build/client" , { maxAge : "1h" } ) ) ;
41
42
app . use ( await import ( BUILD_PATH ) . then ( ( mod ) => mod . app ) ) ;
42
43
}
43
44
44
- app . use ( morgan ( "tiny" ) ) ;
45
-
46
45
app . listen ( PORT , ( ) => {
47
46
console . log ( `Server is running on http://localhost:${ PORT } ` ) ;
48
47
} ) ;
You can’t perform that action at this time.
0 commit comments