You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
참조하면 좋은 링크 (NEXT.js 공식 환경변수 설정 가이드) : https://nextjs.org/docs/pages/building-your-application/configuring/environment-variables
NEXT.js 에서는 API 키와 같은 환경변수를 관리할 때 보통 프로젝트 폴더 루트에 .env로 시작하는 파일을 넣는다.
/.env.local실제 Next.js 코드에서는
로 NEXT.js 빌트인 기능에 의해 process.env.*로
.env.파일명에 파일명에 상관 없이 모든 환경변수들을 자동적으로 로딩한다.실제 배포 시, 예를 들어 vercel에서 배포한다고 한다면 별도로 환경변수를 설정하는 UI가 있어서 거기에 하면 된다.
다른 환경에서 (예, docker로 클라우드에 배포하는 경우) 어떻게 하는지는 추가바람
.gitignore
NEXT.js에서는 프로젝트 생성시 알아서
.env*를.gitignore에 포함시켜준다.Beta Was this translation helpful? Give feedback.
All reactions