index.html 793 Bytes
<!DOCTYPE html>
<html>
<head>
    <title>check insta</title>
</head>
<body>
    <h1>메인 화면</h1>
    <input id="insta_id" placeholder="id" type="text" name="insta_id"/>
    <button id="submit_id">제출</button>
    <script>
        const button = document.querySelector('#submit_id')
        const input = document.querySelector('#insta_id')

        button.addEventListener('click',async () => {
            let result = null;

            try {
                result = await (await fetch('http://localhost:5000/update?insta_id=' + input.value)).json()
            } catch (e) {
                console.log(e)
            } finally {
                if(result) {
                    console.log(result.insta_id)
                }
            }
        })
    </script>
</body>
</html>