Skip to main content

@sveltejs/kit/adapter

import { function applyReroute(url: string, reroute: import("@sveltejs/kit").Reroute): Promise<URL>

If your deployment platform supports splitting your app into multiple functions, you should run this in a middleware that runs before the main handler to reroute the request to the correct function and generate a server-side manifest with the rerouteMiddleware option set to true.

@example
import { applyReroute } from '@sveltejs/kit/adapter';
// replace __HOOKS__ with the path to the reroute hook obtained from `builder.getReroutePath()`
import { reroute } from '__HOOKS__';

export default function middleware(request) {
  return applyReroute(request.url, reroute);
}
@since
2.51.0
applyReroute
} from '@sveltejs/kit/adapter';

applyReroute

Available since 3.0.0

If your deployment platform supports splitting your app into multiple functions, you should run this in a middleware that runs before the main handler to reroute the request to the correct function and generate a server-side manifest with the rerouteMiddleware option set to true.

import { function applyReroute(request: Request, reroute: Reroute): Promise<Request>

If your deployment platform supports splitting your app into multiple functions, you should run this in a middleware that runs before the main handler to reroute the request to the correct function and generate a server-side manifest with the rerouteMiddleware option set to true.

@example
import { applyReroute } from '@sveltejs/kit/adapter';
// replace __HOOKS__ with the path to the reroute hook obtained from `builder.getReroutePath()`
import { reroute } from '__HOOKS__';

export default function middleware(request) {
  return applyReroute(request, reroute);
}
@since
3.0.0
applyReroute
} from '@sveltejs/kit/adapter';
// replace __HOOKS__ with the path to the reroute hook obtained from `builder.getReroutePath()` import { import reroutereroute } from '__HOOKS__'; export default function function middleware(request: any): Promise<Request>middleware(request: anyrequest) { return function applyReroute(request: Request, reroute: Reroute): Promise<Request>

If your deployment platform supports splitting your app into multiple functions, you should run this in a middleware that runs before the main handler to reroute the request to the correct function and generate a server-side manifest with the rerouteMiddleware option set to true.

@example
import { applyReroute } from '@sveltejs/kit/adapter';
// replace __HOOKS__ with the path to the reroute hook obtained from `builder.getReroutePath()`
import { reroute } from '__HOOKS__';

export default function middleware(request) {
  return applyReroute(request, reroute);
}
@since
3.0.0
applyReroute
(request: anyrequest, import reroutereroute);
}
function applyReroute(
	request: Request,
	reroute: Reroute
): Promise<Request>;

Edit this page on GitHub llms.txt