CNode

好神奇的 async http 框架 --- Micro

分享
PPana发布于10 年前最后回复10 年前3 回复5960 浏览0 收藏

第一次看 TJ 大神的 Koa 被惊的不行不行, koa 代码已经够少了, micro更少 100 来行. 而且全面拥抱 ES6 跟 async.

  • Easy. Designed for usage with async and await (more)
  • Fast. Ultra-high performance (even JSON parsing is opt-in).
  • Micro. The whole project is ~100 lines of code.
  • Agile. Super easy deployment and containerization.
  • Simple. Oriented for single purpose modules (function).
  • Explicit. No middleware. Modules declare all dependencies.
  • Standard. Just HTTP!

https://github.com/zeithq/micro

查看回复

回复 (3)

M
magicdawn#1·10 年前

没啥意思~

写一个

module.exports = function * (){
  this.body = 'hello world';
};

然后做个 cli, new 个koa app, use 一下这个generator function. 然后listen, 仅此而已...

  1. 论生态, micro 写的 await json, koa有更为强大的 body-parser, 其他类似...
  2. 论速度, micro说是 Standard. Just HTTP!, 我也是醉了, 你他妈都在服务端babel了, 然后拿自己是原生 http.createServer 说事

有感而发, 纯属吐槽~

W
welefen#2·10 年前

"框架"几乎啥都没干,跟手写用 async/await 有啥区别。。。

A
alsotang#3·10 年前
参与回复
登录后即可参与回复。登录