로컬에서 정상적으로 작동하는 서비스가 vercel 배포시 invelid api key 에러가 발생했다.
API KEY를 .env
파일에서 보관하고 gitignore
에 추가했다. 이같은 이유는 보완상의 이유로 github에 공유되는 것을 막기 위해서였다.
그렇다면... github repository와 연결된 vercel 도 .env
이 공유되지 않은 것이 아닐까?
How do I add environment variables to my Vercel project?
Environment Variables UI
You can add Environment Variables to your site through Project Settings. Values are encrypted at rest and permission to view values can be restricted based on your role. You can also choose a specific Git branch to set Environment Variables for with the Preview environment.
.env
에서 작성한 API KEY 변수와 API KEY를 각각 name과 value에 입력한다.gitignore
에 추가된 파일은 Github에 올라가지 않는다!!