
늦은 시간까지 수고 많으십니다
다름이 아니라 4주차 4번째 강의 수강 중에 오류가 뜨는 부분이 있어서 질문 올립니다
제목에 쓴 그대로 console 창에 메세지가 출력이 안돼요
원래대로라면 콘솔창에
요청을 잘 받았어요
라는 메세지가 떠야하는데

저는 이렇게만 뜨네요.. 도와주시면 감사하겠습니다
작성한 코드 및 에러 메세지
[app.py]
from flask import Flask, render_template, request, jsonify
app = Flask(__name__)
@app.route('/')
def home():
return render_template('index.html')
if __name__ == '__main__':
app.run('0.0.0.0',port=5000,debug=True)
@app.route('/test', methods=['POST'])
def test_post():
title_receive = request.form['title_give']
print(title_receive)
return jsonify({'result':'success', 'msg': '요청을 잘 받았어요'})
----------------------------
[index.html]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
function hey(){
$.ajax({
type: "POST",
url: "/test",
data: { title_give:'봄날은간다' },
success: function(response){
console.log(response['msg'])
}
})
}
</script>
</head>
<body>
<h1>나의 첫 웹 페이지</h1>
<button onclick="hey()">버튼을 눌러주세요</button>
</body>
</html>
