티스토리 뷰
웹프로그래밍/node.js & Typescript
[node.js] How to access the GET parameters in Express.js or Node.js?
jihun202 2015. 6. 10. 12:19반응형
/?parameter="test"
기존 request.param("parameter") 에서... 아래와 같이 업데이트됨;
var app = express();
app.post 일때, request.body.parameter
app.get 일때, request.params.parameter
어떤 방식으로 값이 들어오는지 보려면
console.log(request.params);
console.log(request.body);
console.log(request.query); 를 찍어보자..
또한
app.use(bodyParser.urlencoded({
extended: true
}));
bodyParser 가 urlencoded 로 되어 있어야된다. JSON으로 되있을 경우 JSON 형식만 읽어오기떄문에 undefined가 줄기차게 뜰것임..ㅋㅋ
반응형
'웹프로그래밍 > node.js & Typescript' 카테고리의 다른 글
| [node.js] How to use layout.ejs in Express 4 (0) | 2015.06.11 |
|---|---|
| [node.js] How to get POST a query in Express.js/Node.js? (0) | 2015.06.10 |
| [node.js] Most middleware (like logger) is no longer bundled with Express and must be installed separately... (0) | 2015.06.09 |
| [node.js] express cookie-parser (0) | 2015.06.09 |
| [node.js] Check synchronously if file/directory exists in Node.js (0) | 2015.06.09 |
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- ubuntu
- 카카오뱅크
- 해외주식
- 지도
- 연말정산
- etf
- 아파트매매
- 내집마련
- 안과
- 세금
- 적금
- php
- 신혼부부
- 출산
- remove
- 대출
- 안드로이드
- 공제
- 2026
- 재테크
- 고금리
- 부동산
- 카뱅
- 혜택
- 금융
- 우회
- 앱테크
- 정부
- 투자
- 주담대
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
글 보관함