if ( filteredRoutes.length !== 0 ) {
const routing = Layer.mergeAll( filteredRoutes.shift()!, ...filteredRoutes )
return yield* Layer.launch(
server.run.pipe(
Layer.provide( routing )
).pipe(
Layer.provide( yield* CatchAllHandler ) // must be second to last to apply correctly
).pipe(
Layer.provide( context ) // must be last to apply to all properly
)
)
}
if ( filteredRoutes.length !== 0 ) {
const routing = Layer.mergeAll( filteredRoutes.shift()!, ...filteredRoutes )
return yield* Layer.launch(
server.run.pipe(
Layer.provide( routing )
).pipe(
Layer.provide( yield* CatchAllHandler ) // must be second to last to apply correctly
).pipe(
Layer.provide( context ) // must be last to apply to all properly
)
)
}