#nextjs prisma vercel
1 messages · Page 1 of 1 (latest)
The reason you can access your API with the deployed URL without explicitly setting environment variables might be due to the default behavior of Next.js and Vercel. When deploying your Next.js application to Vercel, environment variables can be configured in the Project Settings. If you've configured Development Environment Variables, you can pull them into a .env.local for usage on your local machine using the command vercel env pull .env.local (source (https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables)).
However, it's important to note that for security reasons, non-NEXT_PUBLIC_ environment variables are only available in the Node.js environment, meaning they aren't accessible to the browser. If you need to make the value of an environment variable accessible in the browser, you have to prefix the variable with NEXT_PUBLIC_ (source (https://nextjs.org/docs/app/building-your-application/configuring/environment-variables)).
For Prisma, the template comes pre-populated with the necessary Prisma schema for the app. If you have already cloned and deployed the template, the build script automatically runs prisma db push for you (source (https://vercel.com/guides/nextjs-multi-tenant-application)).