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

home2 게시판 Node.js, Express 게시판 검색기능 구글 배포 후에 기능 동작 안됨

검색기능 구글 배포 후에 기능 동작 안됨

5 글 보임 - 1 에서 5 까지 (총 5 중에서)
  • 글쓴이
  • #73331

    이순민
    참가자
    제목과 그대로 MongoDB에서 Search 카테고리를 통해 검색기능을 만들었는데
    Vscode에서 서버를 켜서 localhost로 이동하여 검색기능을 이용하면 작동하지만
    구글 배포 후에는 검색을 하면 "Internal Server Error" 이라는 오류가 뜹니다.
    왜 이런현상이 일어나는지 혹시 관련 이슈가 다른 학생분들에게도 있는건지 궁금합니다.
    #73369

    codingapple
    키 마스터
    구글클라우드 콘솔들어가서 로그같은거 출력해봅시다
    #73466

    이순민
    참가자
    
    이거 맞을까요? 좀 희한한건 구글 배포(https://airy-actor-378805.du.r.appspot.com/)에서는 로그인 전에는 검색됩니다. 로그인 후에만 안됩니다.
    localhost에선 로그인 전 후 둘다 검색기능 가능하구요.
    ------------------------------------userindexList-----------------------------------
    
    <!doctype html>
    <html>
    <head>
      <!-- Required meta tags -->
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
      <link href="/public/style.css" rel="stylesheet">
      <!-- Bootstrap CSS -->
      <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css"
        integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
      <title>Hello, world!</title>
    </head>
    <body>
      <%- include ('usernav.html') %>
        <div class="w-50 board-area" style="float: none; margin:0 auto;">
          <table class="table table-hover">
            <thead>
              <tr bgcolor="#BDBDBD" font color="white">
                <th>번호</th>
                <th>제목</th>
                <th>글쓴이</th>
                <th>작성일</th>
              </tr>
            </thead>
            <tbody>
              <% for (let i=0; i < searchWord.length; i++){ %>
                <tr style="cursor:pointer" onclick="location.href='/detail/<%= searchWord[i]._id %>'">
                  <td><%= searchWord[i]._id %></td>
                  <td><%= searchWord[i].title %></td>
                  <td><%= searchWord[i].userNick %></td>
                  <td><%= searchWord[i].date %></td>
                </tr>
                <% } %>
            </tbody>
          </table>
          <div style="display: flex; justify-content: flex-end;">
            <button type="button" class="btn btn-primary" style="margin: 3px;" id="PostWrite">작성하기</button>
          </div>
        </div>
        <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
        <script>
          // 작성하기 버튼 클릭시 작성페이지로 이동
          $('#PostWrite').click(function(){
            location.replace('/write');
          })
          $('#userLogout').click(function(){
            $.ajax({
              url : "/logout",
              type : "GET",
              success : function(결과){
                location.replace('/')
              }
            })
          })
          $('#userTitleSearch').click(function(){
            var 입력값 = $('#userTitleSearch-input').val()
            console.log('입력값은 = '+입력값);
            window.location.replace(`/usersearch?value=${입력값}`)
          })
        </script>
     
        <!-- Optional JavaScript -->
        <!-- jQuery first, then Popper.js, then Bootstrap JS -->
        <!-- <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"
          integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n"
          crossorigin="anonymous"></script> -->
        <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
          integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
          crossorigin="anonymous"></script>
        <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/js/bootstrap.min.js"
          integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6"
          crossorigin="anonymous"></script>
    </body>
    </html>
    ------------------------------------userindexList-----------------------------------
    
    #73486

    codingapple
    키 마스터
    검색시 이상한페이지로 이동하는데 서버코드가 뭔가 이상한게아닐까요
    #73676

    이순민
    참가자
    헐 감사합니다.. 응답.redirect('/userIndexList') 의 i가 대문자여야하는데 소문자로 되어있었습니다..
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 호 / 개인정보관리자 : 박종흠