Rocky_Mountain_Vending/.pnpm-store/v10/files/d9/31cc63a5fc5fca780b2dc10d2265ce93f1462fb38f8aac5034f89af6dab0fb1e4063b8e80afde16339f714ccfb5756f4c9c549a404a831aff778f8b0d0f11e
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

36 lines
No EOL
1.5 KiB
Text

import { wrapApiHandler } from '../../api-utils';
import { RouteModule } from '../route-module';
import { apiResolver } from '../../api-utils/node/api-resolver';
export class PagesAPIRouteModule extends RouteModule {
constructor(options){
super(options);
if (typeof options.userland.default !== 'function') {
throw Object.defineProperty(new Error(`Page ${options.definition.page} does not export a default function.`), "__NEXT_ERROR_CODE", {
value: "E379",
enumerable: false,
configurable: true
});
}
this.apiResolverWrapped = wrapApiHandler(options.definition.page, apiResolver);
}
/**
*
* @param req the incoming server request
* @param res the outgoing server response
* @param context the context for the render
*/ async render(req, res, context) {
const { apiResolverWrapped } = this;
await apiResolverWrapped(req, res, context.query, this.userland, {
...context.previewProps,
trustHostHeader: context.trustHostHeader,
allowedRevalidateHeaderKeys: context.allowedRevalidateHeaderKeys,
hostname: context.hostname,
multiZoneDraftMode: context.multiZoneDraftMode,
dev: context.dev,
internalRevalidate: context.internalRevalidate
}, context.propagateError, context.dev, context.page, context.onError);
}
}
export default PagesAPIRouteModule;
//# sourceMappingURL=module.js.map