un
V2EX  ›  Node.js

为什么 koa、express 不提供 HTTP body parser

  •  
  •   un · May 6, 2014 · 3848 views
    This topic created in 4400 days ago, the information mentioned may be changed or developed.
    body parser 不是很基本的需求么。框架集成不好么?
    写个小应用还要 require 一大堆 middelware 。
    4 replies    2014-05-07 09:19:21 +08:00
    youyudehexie
        1
    youyudehexie  
       May 6, 2014
    某天大伙给tj 提交了很多需求得issue ,tj表示不爽这帮人,然后就索性,都模块化了。你们自己写,如果用得不爽
    guchengf
        2
    guchengf  
       May 6, 2014
    之前一大堆middleware的时候大家不满意,所以。。。
    fundon
        3
    fundon  
       May 6, 2014
    "Koa is a new web framework designed by the team behind Express, which aims to be a smaller, more expressive, and more robust foundation for web applications and APIs. "

    这是koa瞄准的方向。

    其实新版的express,已经逐步把bodyparser等中间件脱离出来,目的也是精简核心功能,不想集成太多中间件。
    https://github.com/visionmedia/express/blob/master/lib/express.js#L66
    steeeeps
        4
    steeeeps  
       May 7, 2014
    commonjs 不是推崇模块化嘛,模块化了更好,框架也更小,
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1334 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 17:10 · PVG 01:10 · LAX 10:10 · JFK 13:10
    ♥ Do have faith in what you're doing.