티스토리 뷰
/* detail : 해당 글 번호의 상세페이지 이동 */
// URL parameter
app.get('/detail/:id', function (요청, 응답) {
db.collection('post').findOne({ _id: parseInt(요청.params.id) }, function (에러, 결과) {
console.log(결과);
응답.render('detail.ejs', { data: 결과 });
});
});
'Server > Node.js' 카테고리의 다른 글
| [Node.js] Session으로 로그인 구현 (0) | 2023.07.16 |
|---|---|
| [Node.js] PUT; 수정하기 (0) | 2023.07.16 |
| [Node.js] AJAX로 삭제 요청하기 (0) | 2023.07.15 |
| [Node.js] auto increment; 글 번호를 달자 (0) | 2023.07.14 |
| [Node.js] MongoDB 세팅 (0) | 2023.07.13 |
댓글
