| 1352 | }; |
| 1353 | |
| 1354 | export const shouldServe: ShouldServe = opts => { |
| 1355 | const framework = opts.config.framework; |
| 1356 | if (isPythonFramework(framework)) { |
| 1357 | const requestPath = opts.requestPath.replace(/\/$/, ''); |
| 1358 | // Don't override API routes if another builder already matched them |
| 1359 | if (requestPath.startsWith('api') && opts.hasMatched) { |
| 1360 | return false; |
| 1361 | } |
| 1362 | // Public assets are served by the static builder / default handler |
| 1363 | return true; |
| 1364 | } |
| 1365 | return defaultShouldServe(opts); |
| 1366 | }; |
| 1367 | |
| 1368 | export const defaultShouldServe: ShouldServe = ({ |
| 1369 | entrypoint, |
nothing calls this directly
no test coverage detected