fix: tailwind now respects basepath (#2138)
This commit is contained in:
@@ -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,
|
||||
);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user