Fastify 是一个高度专注于以最少开销和强大的插件架构为开发者提供最佳体验的 Web 框架,号称是目前最快的 Node.js 应用框架之一。 它受 Hapi 和 Express 的启发。
示例代码[code]// 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}`)
})[/code]Fastify v1.2.0 更新内容:
改进
Better error messages for json schema errors
Add support for handler in shorthand route options.
修复
Better handling of 404 routes
Internals
Add reply serialize test
Update to find my way 1.11.0
文档
Added LTS in ToC
Minor corrections to documentation
软件详情:https://github.com/fastify/fastify/
下载地址:https://git.oschina.net/mirrors/Fastify
来自:开源中国社区