Not sure if that is relates, as locally it works
Not sure if that is relates, as locally it works
npx wrangler devnpx wrangler pages dev .vercel/output/static --compatibility-flags="nodejs_compat" --port 8788npx wrangler pages dev but I think that makes no difference...wrangler.toml look?dev env, fwiwnpx wrangler d1 execute audition --command "SELECT * FROM _some_table_;" --local does that work?/favicon.ico_routes.json like: _routes is Pages specific, not for Workers generically, but yesgetRequestContext for next on pages, idk how you haven't stumbled upon itgetRequestContext is for prod environment specifically, but it also should work on local if im not mistaken.env getRequestContext().env and couple of other cloudflare related things, such as city and country of the request originnpx wrangler devimport { PrismaClient } from '@prisma/client';
import { PrismaD1 } from '@prisma/adapter-d1';
export const onRequestGet: PagesFunction<Env> = async (context) => {
const adapter = new PrismaD1(context.env.DB)
const prisma = new PrismaClient({ adapter })npx wrangler pages dev .vercel/output/static --compatibility-flags="nodejs_compat" --port 8788npx wrangler pages devdevnpx wrangler d1 execute audition --command "SELECT * FROM _some_table_;" --local/favicon.ico_routes.json{
"version": 1,
"include": ["/api/*"],
"exclude": ["/*.*"]
}_routesgetRequestContextgetRequestContextgetRequestContext().envconst url = new URL(request.url);
if (url.pathname === '/something') {
// do your work
}