feat: expose config in context + simplify page props (#2102)
This commit is contained in:
@@ -257,6 +257,7 @@ export class ServerContext {
|
||||
const ctx: FreshContext = {
|
||||
url,
|
||||
params: {},
|
||||
config: _self.#state.config,
|
||||
basePath: _self.#state.config.basePath,
|
||||
localAddr: connInfo.localAddr,
|
||||
remoteAddr: connInfo.remoteAddr,
|
||||
@@ -264,6 +265,7 @@ export class ServerContext {
|
||||
isPartial: url.searchParams.has(PARTIAL_SEARCH_PARAM),
|
||||
destination: "route",
|
||||
error: undefined,
|
||||
codeFrame: undefined,
|
||||
Component: NOOP_COMPONENT,
|
||||
next: NOOP_NEXT,
|
||||
render: NOOP_NEXT,
|
||||
@@ -272,6 +274,9 @@ export class ServerContext {
|
||||
return await renderNotFound(req, ctx);
|
||||
},
|
||||
route: "",
|
||||
get pattern() {
|
||||
return ctx.route;
|
||||
},
|
||||
data: undefined,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user