首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

Fastify 1.2.0 发布,号称速度最快的 Node.js Web 框架

Fastify 是一个高度专注于以最少开销和强大的插件架构为开发者提供最佳体验的 Web 框架,号称是目前最快的 Node.js 应用框架之一。 它受?Hapi 和 Express 的启发。

示例代码

代码语言:javascript
复制
//?Require?the?framework?and?instantiate?itconst?fastify?=?require('fastify')()//?Declare?a?routefastify.get('/',?function?(request,?reply)?{
??reply.send({?hello:?'world'?})
})//?Run?the?server!fastify.listen(3000,?'127.0.0.1',?function?(err)?{
??if?(err)?throw?err
??console.log(`server?listening?on?${fastify.server.address().port}`)
})

Fastify v1.2.0 更新内容:

改进

  • Better error messages for json schema errors -?#860
  • Add support for handler in shorthand route options. -?#843

修复

  • Better handling of 404 routes -?#862

Internals

  • Add reply serialize test -?#857
  • Update to find my way 1.11.0 -?#855

文档

  • Added LTS in ToC -?#853
  • Minor corrections to documentation -?#852
  • 发表于:
  • 原文链接https://www.oschina.net/news/94602/fastify-1-2-0-released
  • 如有侵权,请联系 cloudcommunity@tencent.com 删除。

扫码

添加站长 进交流群

领取专属 10元无门槛券

私享最新 技术干货

扫码加入开发者社群
领券
http://www.vxiaotou.com