작성
·
142
0
제목같이 firebase에 올리려 하는데 잘 되지가 않습니다.
제가 기본 지식이 많이 부족해서요..
MySQl은 GCP의 CloudSQL에 연결하였습니다.
아래는 firebase.json의 내용이고요..
아래는 index.js를 위 firebase.json과 맞춘겁니다.
그렇게 해서 firebase serve로 서버 실행을 하면 로컬에서는 정상적으로 되는 것처럼 보입니다.
그런데 port관련해서 조금 문제가 있는 듯합니다.
아래는 실행 후 나오는 내용들 중 일부...
+ functions: Using node@12 from host.
i functions: Watching "C:\Users\xxxxx\Node_js_Test\node_js_textbook\nodebird2firebase\functions"
i hosting: Serving hosting files from: public
+ hosting: Local server: http://localhost:5000
> process.env.PORT: undefined
+ functions[app]: http function initialized (http://localhost:5001/xxxx/us-central1/app).
> running @ 80 port by me...
> success database connection...
위와 같이 내가 지정한 포트는 80, 위에 firebase가 로컬에서 지정한 포트는 5000번 포트.. 그런데 실행은 정상적인듯 합니다. 포트 80에서 돌아 갑니다.
자료 올라가고, 조회되고, 로그인되고, 카카오도...
그런데 GCP firebase cloud Function에 deploy하면 아래와 같이 에러가 발행하네요..
i deploying functions
i functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i functions: ensuring required API cloudbuild.googleapis.com is enabled...
+ functions: required API cloudbuild.googleapis.com is enabled
+ functions: required API cloudfunctions.googleapis.com is enabled
i functions: preparing functions directory for uploading...
i functions: packaged functions (85.94 KB) for uploading
+ functions: functions folder uploaded successfully
i functions: updating Node.js 12 function app(us-central1)...
Functions deploy had errors with the following functions:
app(us-central1)
To try redeploying those functions, run:
firebase deploy --only "functions:app"
To continue deploying other features (such as database), run:
firebase deploy --except functions
Error: Functions did not deploy properly.
deploy 시의 메시지는 위와 같으며
주의: 버전 7.7.0 이하의 Firebase CLI로 배포된 새로운 HTTP 및 HTTP 호출 가능 함수는 기본적으로 비공개이며, 호출하면 HTTP 403 오류가 발생합니다. 새 함수를 배포하기 전에 명시적으로 이 함수를 공개로 설정하거나 Firebase CLI를 업데이트하세요.
위의 내용도 인증되지 않은 호출 허용 과 같이 수정을 하였습니다.
아주 작은 샘플 스태틱 페이지는 정상적으로 됨을 확인 하였고요..
포트 지정이나 그런 부분에 무슨 문제가 있을까요?
고견을 부탁드립니다. 감사합니다.
ps. AWS에 시스템을 올렸더니 시스템이 너무 잘 죽네요.. 물론 디버깅을 해야겠지만 firebase가 더 좋은 솔루션 같아 진행을 하고 있습니다.