• 로그인
  • 장바구니에 상품이 없습니다.

home2 게시판 Node.js, Express 게시판 구글 클라우드 재업로드 질문입니다.

구글 클라우드 재업로드 질문입니다.

  • 이 주제에는 4개 답변, 2명 참여가 있으며 김창규4 년 전에 전에 마지막으로 업데이트했습니다.
5 글 보임 - 1 에서 5 까지 (총 5 중에서)
  • 글쓴이
  • #11449

    김창규
    참가자

    안녕하세요 제가 구글클라우드를 이용하여 업로드 했던걸 다시 수정할 점이 보여서 재업로드를 하기위해 git init , git deploy를 다시 하였는데 재업로드가 안 돼어서 잘문드립니다. git init 과 git deploy를 입력 하기 전 입력해야 하는 다른 명령어가 있는건가요? 아래는 명령어를 입력시 나오는 출력문입니다.

     

    Settings from your current configuration [default] are:
    accessibility:
    screen_reader: 'False'
    compute:
    region: asia-northeast2
    zone: asia-northeast2-a
    core:
    account: 기존 이메일 적혀있는 곳
    disable_usage_reporting: 'True'
    project: shopproject-319605

    Pick configuration to use:
    [1] Re-initialize this configuration [default] with new settings
    [2] Create a new configuration
    Please enter your numeric choice: 1

    Your current configuration has been set to: [default]

    You can skip diagnostics next time by using the following flag:
    gcloud init --skip-diagnostics

    Network diagnostic detects and fixes local network connection issues.
    Checking network connection...done.
    Reachability Check passed.
    Network diagnostic passed (1/1 checks passed).

    Choose the account you would like to use to perform operations for
    this configuration:
    [1] 기존 이메일 적혀있는 곳
    [2] Log in with a new account
    Please enter your numeric choice: 1

    You are logged in as: [기존 이메일 적혀있는 곳].

    Pick cloud project to use:
    [1] healthy-clock-267805
    [2] nwitter-c7ba4
    [3] plated-envoy-319403
    [4] shopproject-319605
    [5] Create a new project
    Please enter numeric choice or text value (must exactly match list
    item): 4

    Your current project has been set to: [shopproject-319605].

    Your Google Cloud SDK is configured and ready to use!

    * Commands that require authentication will use 기존 이메일 적혀있는 곳 by default
    * Commands will reference project shopproject-319605 by default
    Run gcloud help config to learn how to change individual settings

    This gcloud configuration is called [default]. You can create additional configurations if you work with multiple accounts and/or projects.
    Run gcloud topic configurations to learn more.

    Some things to try next:

    * Run gcloud --help to see the Cloud Platform services you can interact with. And run gcloud help COMMAND to get help on any gcloud command.
    * Run gcloud topic --help to learn about advanced features of the SDK like arg files and output formatting
    PS C:\Users\user\OneDrive\바탕 화면\iamport-react-example-master> gcloud app deploy
    Services to deploy:

    descriptor: [C:\Users\user\OneDrive\바탕 화면\iamport-react-example-master\app.yaml]
    source: [C:\Users\user\OneDrive\바탕 화면\iamport-react-example-master]
    target project: [shopproject-319605]
    target service: [default]
    target version: [20210712t154727]
    target url: [https://shopproject-319605.dt.r.appspot.com]
    target service account: [App Engine default service account]

    Do you want to continue (Y/n)? Y

    #11452

    codingapple
    키 마스터

    gcloud app deploy 그냥 이것만 하면 잘됩니다 

    여기에 에러메세지는 없어보이는데요 아마 구글클라우드 콘솔들어가면 에러메세지같은거 확인가능합니다 

    #11454

    김창규
    참가자

    구글 클라우드에서 확인 해보니 아래와 같은 에러가 생겼습니다. 그런데 서버에서 동작시켜본 결과 정상 작동 하였습니다. 아래에는 에러 메세지와  에러가 나는 코드 부분입니다.

    TypeError: Cannot read property 'replace' of undefined

     

     //post 요청
    //크립토 라이브러리를 이용하여 비밀번호를 암호화 하여 보관함
     app.post('/Sign_up',function(req,rsp){
       //전화번호 하이폰 적용
     req.body.phone = req.body.phone.replace(/(^02.{0}|^01.{1}|[0-9]{3})([0-9]+)([0-9]{4})/,"$1-$2-$3")
       console.log(req.body)
       model.findOne({ id: req.body.id },function(err,result){
         if(err) rsp.status(400).send({ message: '회원가입에 실패했습니다.' })
         if(result){
            return rsp.status(400).send({ message: '이미 존재하는 아이디 입니다.' })
          }
         if(!result){
          crypto.randomBytes(64, (err, buf) => {
            if(err) rsp.status(400).send({ message: '회원가입에 실패했습니다.' })
            crypto.pbkdf2(req.body.pw, buf.toString('base64'), 123121, 64, 'sha512', (err, key) => {
              if(err) rsp.status(400).send({ message: '암호화에 실패했습니다.' })
              const user = new model({
                _id: new mongoose.Types.ObjectId(),
                id: req.body.id,
                pw: key.toString('base64'),
                name : req.body.name,
                phone: req.body.phone,
                salt: buf.toString('base64'),
              });
              user.save()
              .then(() => { 
                return rsp.status(200).send({ message: '회원가입에 성공했습니다.' })
              })
              .catch((err) => { 
                return rsp.status(400).send({ messgae: '가입에 실패했습니다 다시 시도해 주십시오',error: err })
              })
            });
          });
         }
       })
     });

    #11459

    codingapple
    키 마스터

    req.body.phone이 숫자거나 아니면 undefined라서 replace()를 붙일 수 없다는 것 같군요 

    req.body.phone.toString().replace() 이런건 어떨까요 

     

    #11525

    김창규
    참가자

    버그는.... 제가 리엑트로 작업하고 빌드를 하지 않았던 것이 문제였습니다.. 죄송합니다

5 글 보임 - 1 에서 5 까지 (총 5 중에서)
  • 답변은 로그인 후 가능합니다.

About

현재 월 700명 신규수강중입니다.

  (09:00~20:00) 빠른 상담은 카톡 플러스친구 코딩애플 (링크)
  admin@codingapple.com
  이용약관
ⓒ Codingapple, 강의 예제, 영상 복제 금지
top

© Codingapple, All rights reserved. 슈퍼로켓 에듀케이션 / 서울특별시 강동구 고덕로 19길 30 / 사업자등록번호 : 212-26-14752 온라인 교육학원업 / 통신판매업신고번호 : 제 2017-서울강동-0002 호 / 개인정보관리자 : 박종흠