JavaScript/Exress
-
에러로그 : winston, morganJavaScript/Exress 2022. 10. 12. 21:23
https://github.com/winstonjs/winston GitHub - winstonjs/winston: A logger for just about everything. A logger for just about everything. Contribute to winstonjs/winston development by creating an account on GitHub. github.com https://www.npmjs.com/package/winston winston A logger for just about everything.. Latest version: 3.8.2, last published: a month ago. Start using winston in your project b..
-
express.urlenconded()JavaScript/Exress 2022. 10. 11. 20:11
헤더에서 규정되는 content-type을 보라. x-www-form-urlencoded 형태를 받는다. 위의 예시는 클라이언트에서 form 태그를 통해 전송되었다. 이 말은 곧, form 태그로 전송되는 값은 express.json() 이 아니라 express.urlexcoded()로 받아야 한다는 것. 더보기 This is a built-in middleware function in Express. It parses incoming requests with urlencoded payloads and is based on body-parser. 내장된 미들웨어. "urlencoded payload"로 들어오는 리퀘스트를 파싱. body-parser 기반. 지금은 express 패키지 안에 body-pa..
-
express.routerJavaScript/Exress 2022. 10. 11. 20:03
const router = express.Router([options]) 새로운 라우터 객체를 찍어낸다. 옵션에 들어갈 수 있는 것들 caseSensitive default 값이 disabled. 그간 열심히 '/posts' 를 '/Posts' 로 쓰지 않기 위해 기울였던 노력은 허사였다네. mergeParams Preserve the req.params values from the parent router. If the parent and the child have conflicting param names, the child’s value take precedence. 라우터 파라미터에 대한 고질적인 이슈. https://inmanustuaspater.tistory.com/115 strict 디폴트는..
-
Express) app 객체, request 객체JavaScript/Exress 2022. 10. 1. 10:07
https://expressjs.com/en/api.html#express Express 4.x - API Reference Express 4.x API express() Creates an Express application. The express() function is a top-level function exported by the express module. var express = require('express') var app = express() Methods express.json([options]) This middleware is available in Ex expressjs.com app 객체 관용적으로(conventionally) express 어플리케이션을 표시. app 객체를 ..