File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
packages/remix/src/utils/serverAdapters Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -24,10 +24,6 @@ function wrapExpressRequestHandler(
24
24
) : ExpressRequestHandler {
25
25
let routes : ServerRoute [ ] ;
26
26
27
- if ( build && 'routes' in build ) {
28
- routes = createRoutes ( build . routes ) ;
29
- }
30
-
31
27
return async function (
32
28
this : unknown ,
33
29
req : ExpressRequest ,
@@ -52,7 +48,7 @@ function wrapExpressRequestHandler(
52
48
const url = new URL ( request . url ) ;
53
49
54
50
// This is only meant to be used on development servers, so we don't need to worry about performance here
55
- if ( ! routes && typeof build === 'function' ) {
51
+ if ( build && typeof build === 'function' ) {
56
52
const resolvedBuild = build ( ) ;
57
53
58
54
if ( resolvedBuild instanceof Promise ) {
@@ -61,6 +57,8 @@ function wrapExpressRequestHandler(
61
57
} else {
62
58
routes = createRoutes ( resolvedBuild . routes ) ;
63
59
}
60
+ } else {
61
+ routes = createRoutes ( build . routes ) ;
64
62
}
65
63
66
64
const [ name , source ] = getTransactionName ( routes , url ) ;
You can’t perform that action at this time.
0 commit comments