Fastify 是一个高度专注于以最少开销和强大的插件架构为开发者提供最佳体验的 Web 框架,号称是目前最快的 Node.js 应用框架之一。 它受 Hapi 和 Express 的启发。
示例代码
// Require the work 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
文档
继续阅读与本文标签相同的文章
上一篇 :
详解如何创建并发布一个 vue 组件
下一篇 :
vue-cli3.0 环境变量与模式配置方法
-
菜鸟裹裹快递员收入有多高?小哥晒出月流水,程序员表示羡慕了
2026-05-19栏目: 教程
-
开发者必读 · 周报 | 002期
2026-05-19栏目: 教程
-
斩获2019中国金融科技创新大赛金奖,蚂蚁金服mPaaS助力打造超级App生态
2026-05-19栏目: 教程
-
有呀!互联网icp许可证除申请以外有转让的吗?飞起
2026-05-19栏目: 教程
-
Apache Zepplin使用Hive Interpreter查询
2026-05-19栏目: 教程
