API resolved without sending a response for /api/auth/signup, this may result in stalled requests.
register페이지에서 회원가입을 누르면 이러한 오류가 뜨는데 아무리 구글링해도 답을 못찾겠습니다..
register 페이지
export default function Register() {
return (
<div>
<form method="POST" action="/api/auth/signup">
<input name="name" type="text" placeholder="이름" />
<input name="email" type="text" placeholder="이메일" />
<input name="password" type="password" placeholder="비번" />
<button type="submit">id/pw 가입요청</button>
</form>
</div>
)
}
signup.js
import { connectDB } from "@/util/database";
import bcrypt from 'bcrypt'
export default async function handler(req, res){
if (req.methode == 'POST'){
let hash = await bcrypt.hash(req.body.password,10);
console.log(hash);
console.log(req.body);
let db = (await connectDB).db('AnimalAnywhere');
await db.collection('user_cred').insertOne(req.body);
res.status(200).redirect('/');
}
}