V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
un
V2EX  ›  Node.js

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

  •  
  •   un · 2014-05-06 14:33:15 +08:00 · 3143 次点击
    这是一个创建于 3642 天前的主题,其中的信息可能已经有所发展或是发生改变。
    body parser 不是很基本的需求么。框架集成不好么?
    写个小应用还要 require 一大堆 middelware 。
    4 条回复    2014-05-07 09:19:21 +08:00
    youyudehexie
        1
    youyudehexie  
       2014-05-06 14:42:42 +08:00
    某天大伙给tj 提交了很多需求得issue ,tj表示不爽这帮人,然后就索性,都模块化了。你们自己写,如果用得不爽
    guchengf
        2
    guchengf  
       2014-05-06 14:43:21 +08:00
    之前一大堆middleware的时候大家不满意,所以。。。
    fundon
        3
    fundon  
       2014-05-06 14:48:10 +08:00
    "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  
       2014-05-07 09:19:21 +08:00
    commonjs 不是推崇模块化嘛,模块化了更好,框架也更小,
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3172 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 14:38 · PVG 22:38 · LAX 07:38 · JFK 10:38
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.