4. Express 특징
• Robust routing
• HTTP helpers (redirection, caching, etc)
• Content negotiation
• Focus on high performance
• Executable for generating applications
quickly
• High test coverage
23. 라우팅과 HTTP method
• POST
• app.post()
• GET
• app.get()
• DELTE
• app.delete()
• PUT
• app.put()
* form에서 PUT,DELETE method를 지원하지 않으므로
_method사용하여서 method 지원
<input type=‘hidden’ value=‘put’ name=‘_method’ />
* express에서 HTTP method를 적절하게 처리 하기 위해서
methodOverride() configure에 추가.
app.use(express.bodyParser()) 다음에 추가
app.use(express.methodOVerride())
24. methodOverride()
*_method라는 숨겨진 파라미터를 이용하여 원하는 method 지정
*X-HTTP-Method-Override는 body 내용이 xml or application/x-www-form-
urlencoded경우 사용(Header 값을 읽어서 처리)
25. MVC의 도입
• 모든기능을 하나의 js파일에 넣는것은 비효율적.
• Express에서는 라우팅을 사용하고 있음