Linuxeden 开源社区 --
Fastify 是一个高度专注于以最少开销和强大的插件架构为开发者提供最佳体验的 Web 框架,号称是目前最快的 Node.js 应用框架之一。 它受 Hapi 和 Express 的启发。
示例代码
// 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
文档
转自 https://ift.tt/2pIcfEs
The post Fastify 1.2.0 发布,号称速度最快的 Node.js Web 框架 appeared first on Linuxeden开源社区.
https://ift.tt/2G9O50H
没有评论:
发表评论