• 카테고리

    질문 & 답변
  • 세부 분야

    풀스택

  • 해결 여부

    미해결

heroku 배포에 대해 질문이 있습니다..

20.11.18 23:52 작성 조회수 151

0

https://www.youtube.com/watch?v=qdoiwouykAg

에서 heroku 배포를 진행중입니다.

예제를 따라하고 이제 배포를 하려고 했는데 화면이 저렇게만 뜨는데 왜이런걸까요...

로컬에서는 로그인과 회원가입까지 잘되는데.. heroku 로그를 보면

MongooseServerSelectionError: Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted. Make sure your current IP address is on your Atlas cluster's IP whitelist: https://docs.atlas.mongodb.com/security-whitelist/

이런 에러로그입니다... 이유가 뭘까요..

답변 2

·

답변을 작성해보세요.

1

안녕하세요 ~ 

MongooseServerSelectionError: Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted. Make sure your current IP address is on your Atlas cluster's IP whitelist: https://docs.atlas.mongodb.com/security-whitelist/


이 에러는 방화벽에 관한 에러 입니다 ~   
몽고DB 사이트에 가서  whitelist를 현재 위치를 넣어줄수 있는 곳이 있습니다. 
그곳에서  현재 IP를 넣어주셔서 방화벽을 열어주세요 ~  

0

Aurora님의 프로필

Aurora

질문자

2020.11.19

위의 에러로그는 몽고DB 접속 IP관련 에러로

0.0.0.0/0 로 설정해서 connected되었습니다.

하지만 문제는.. 배포를 했을 때 나오는 페이지가 저렇게 Hello World가 나오는데 왜 이렇게 나오는지 잘 모르겠습니다 ㅠ.ㅠ

창을 열면 2020-11-18T15:31:25.610436+00:00 heroku[router]: at=info method=GET path="/" host=lit-bastion-23296.herokuapp.com request_id=39bba0f1-dba7-4be5-b58a-c2aac7d45760 fwd="122.43.26.91" dyno=web.1 connect=1ms service=3ms status=304 bytes=150 protocol=https

이런 로그가 뜹니다,.

setupProxy.js 만든파일에서 뭔가 문제가 있는걸까요??

const { createProxyMiddleware } = require('http-proxy-middleware');

module.exports = function (app) {
  app.use(
    '/api',
    createProxyMiddleware({
      target: 'http://localhost:5000',
      changeOrigin: true,
    }),
  );
};
target에 로컬이라고 되어있어서.. 찜찜합니다..
https://lit-bastion-23296.herokuapp.com/
사이트 주소입닏...