write.html
<h4 class="container mt-4"><strong>글 작성페이지</strong></h4>
<div class="container mt-3">
<form action="/add" method="post">
<div class="form-group">
<label>오늘의 할일</label>
<input type="text" class="form-control" name="title">
</div>
<div class="form-group">
<label>날짜</label>
<input type="text" class="form-control" name="date">
</div>
<button type="submit" class="btn btn-outline-secondary">Submit</button>
</form>
</div>
server.js
app.get('/write', function(요청내용, 응답할방법) {
응답할방법.sendFile(__dirname + '/write.html')
})
app.post('/add', (요청내용, 응답할방법) =>{
응답할방법.send('test');
console.log(요청내용.body.title);
console.log(요청내용.body.date);
})