fix: tailwind now respects basepath (#2138)

This commit is contained in:
Reed von Redwitz
2023-12-05 13:13:33 +01:00
committed by GitHub
parent 80d35223d3
commit 60b2198d13
31 changed files with 323 additions and 12 deletions
+4 -2
View File
@@ -1,5 +1,5 @@
import { SEP } from "./deps.ts";
import { ErrorHandler, FinalHandler, RouteResult } from "./router.ts";
import { ErrorHandler, FinalHandler, RouteResult, withBase } from "./router.ts";
import {
BaseRoute,
FreshContext,
@@ -59,6 +59,7 @@ export function composeMiddlewares(
url: string,
) => RouteResult,
renderNotFound: UnknownRenderFunction,
basePath: string,
) {
return (
req: Request,
@@ -72,7 +73,8 @@ export function composeMiddlewares(
// identify middlewares to apply, if any.
// middlewares should be already sorted from deepest to shallow layer
const mws = selectSharedRoutes(
paramsAndRouteResult.route?.baseRoute ?? ROOT_BASE_ROUTE,
paramsAndRouteResult.route?.baseRoute ??
toBaseRoute(withBase(ROOT_BASE_ROUTE, basePath)),
middlewares,
);
+1
View File
@@ -166,6 +166,7 @@ export class ServerContext {
handlers.errorHandler,
router.getParamsAndRoute(handlers),
renderNotFound,
basePath,
);
const trailingSlashEnabled = this.#state.config.router?.trailingSlash;
const isDev = this.#dev;