#prisma mongodb
1 messages · Page 1 of 1 (latest)
The reason you can access your API with the deployed URL even without adding your environment variables might be due to the default behavior of Next.js and Vercel. When you deploy a Next.js application on Vercel, it automatically provides a URL for your deployment. This URL can be used to access your API routes, regardless of whether you've set up environment variables or not.
However, it's important to note that while you can access your API, it might not function correctly without the necessary environment variables. For instance, if your API relies on a database connection string or authentication keys stored in environment variables, it won't be able to establish a connection to your database or authenticate requests without these.
In your case, as you're using Prisma, NextAuth, and MongoDB, you'll likely need to set up environment variables for your database connection, authentication, and any other sensitive data. For example, you might need to set up DATABASE_URL for Prisma, and GITHUB_ID, GITHUB_SECRET, and NEXTAUTH_URL for NextAuth (source (https://vercel.com/guides/nextjs-prisma-postgres)).
To add your environment variables, you can go to the Environment Variables page of your Project Settings on Vercel and enter the desired Name and Value for each variable (source (https://vercel.com/docs/projects/environment-variables)).