(config: Config, path: string)
| 32 | } |
| 33 | |
| 34 | function fixPath(config: Config, path: string) { |
| 35 | const { stripRoutePrefix } = config; |
| 36 | if (!stripRoutePrefix) return path; |
| 37 | if (path === `/${stripRoutePrefix}`) return "/"; |
| 38 | return path.replace( |
| 39 | stripRoutePrefix.endsWith("/") ? stripRoutePrefix : stripRoutePrefix + "/", |
| 40 | "" |
| 41 | ); |
| 42 | } |
| 43 | |
| 44 | async function writeRoutes(silent: boolean = false) { |
| 45 | const config = getConfig(); |