Rocky_Mountain_Vending/.pnpm-store/v10/files/99/cdfe2c4a641cf52155e8d8e5fb6efc08bf19e5ab145d7fbb1df6a5911243f3b3fd3719a92a808b0deff38153569ca4ff80753574867c808ad377c5e0f7ced7
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

42 lines
No EOL
1.6 KiB
Text

import { getModuleBuildInfo } from './get-module-build-info';
import { stringifyRequest } from '../stringify-request';
const nextEdgeFunctionLoader = function nextEdgeFunctionLoader() {
const { absolutePagePath, page, rootDir, preferredRegion, middlewareConfig: middlewareConfigBase64 } = this.getOptions();
const stringifiedPagePath = stringifyRequest(this, absolutePagePath);
const buildInfo = getModuleBuildInfo(this._module);
const middlewareConfig = JSON.parse(Buffer.from(middlewareConfigBase64, 'base64').toString());
buildInfo.route = {
page: page || '/',
absolutePagePath,
preferredRegion,
middlewareConfig
};
buildInfo.nextEdgeApiFunction = {
page: page || '/'
};
buildInfo.rootDir = rootDir;
return `
import 'next/dist/esm/server/web/globals'
import { adapter } from 'next/dist/esm/server/web/adapter'
import { IncrementalCache } from 'next/dist/esm/server/lib/incremental-cache'
import { wrapApiHandler } from 'next/dist/esm/server/api-utils'
import handler from ${stringifiedPagePath}
if (typeof handler !== 'function') {
throw new Error('The Edge Function "pages${page}" must export a \`default\` function');
}
export default function nHandler (opts) {
return adapter({
...opts,
IncrementalCache,
page: ${JSON.stringify(page)},
handler: wrapApiHandler(${JSON.stringify(page)}, handler),
})
}
`;
};
export default nextEdgeFunctionLoader;
//# sourceMappingURL=next-edge-function-loader.js.map