moa-router一个快速的 HTTP 路由器
一个快速的 HTTP 路由器,在内部使用一个高性能的基数树(Radix Tree )(又名紧凑前缀树(Prefix Tree)),支持路由参数,通配符,它是独立的框架。
性能
$ autocannon 127.0.0.1:3000/test
QPS
moa-router(http) 28456
moa-router(koa) 17439.6
koa-router 12748.73
moa-router(express) 11779.1
express-router 10374.6
安装
$ npm i --save moa-router
使用
Koa
const http = require('http') const Koa = require('koa'); const app = new Koa(); const router = require('moa-router')() router.get('/', (ctx, next) => { ctx.body = {'path': 'root'} }) router.on('GET', '/test', (ctx, next) => { ctx.body = {'hello': 'world'} }) app.use(router.routes()); app.use(async function (ctx, next) { ctx.body = "default" }); const server = http.createServer(app.callback()) server.listen(3030, err => { if (err) throw err console.log('Server listening on: http://localhost:3000') })
评论
BunRouter用于 Go 的快速灵活的 HTTP 路由器
BunRouter是一个用于Go的极快的HTTP路由器,具有独特的功能组合:中间件允许将HTTP处理程序中的常见操作提取到可重用的函数中。错误处理允许通过处理中间件中的错误来进一步减小HTTP处理程序
BunRouter用于 Go 的快速灵活的 HTTP 路由器
0
BunRouter用于 Go 的快速灵活的 HTTP 路由器
BunRouter 是一个用于 Go 的极快的 HTTP 路由器,具有独特的功能组合:中间件允许将
BunRouter用于 Go 的快速灵活的 HTTP 路由器
0
fasthttpGo 的快速 HTTP 包
fasthttp是Go的快速HTTP实现,当前在1M并发的生产环境使用非常成功,可以从单个服务器进行100Kqps的持续连接。HTTP服务器性能与net/http比较总而言之,fasthttp比net
fasthttpGo 的快速 HTTP 包
0
FleaHttpd小型快速的HTTP服务器
fleahttpd:“跳蚤服务器”,是一个用C从头写的一个轻量级网络伺服器,静态文件的抓取速度大概是Apache的三倍。查看FleaHttpd与Apache之间的性能比较结果。
FleaHttpd小型快速的HTTP服务器
0
rails-asyncweb快速 Http 服务器
rails-asyncweb 是用于 JRuby on Rails 的一个快速 Http 服务器。
rails-asyncweb快速 Http 服务器
0
一个 HTTP 请求的曲折经历
点击关注上方“杰哥的IT之旅”,后台回复“Python自动化”获取精心整理的PDF。来源:8rr.co/6usv从一个经典的面试题说起,输入URL到页面展现的过程: 输入URL后,会先进行域名解析。优先查找本地host文件有无对应的IP地址...
杰哥的IT之旅
0