nanjixiong218 / Analys Middlewares
redux, koa, express 中间件对比实现分析
Stars: ✭ 83
Programming Languages
javascript
184084 projects - #8 most used programming language
Projects that are alternatives of or similar to Analys Middlewares
Node Tutorial
☺️Some of the node tutorial -《Node学习笔记》
Stars: ✭ 364 (+338.55%)
Mutual labels: express, koa
Create Graphql
Command-line utility to build production-ready servers with GraphQL.
Stars: ✭ 441 (+431.33%)
Mutual labels: express, koa
Graphql Upload
Middleware and an Upload scalar to add support for GraphQL multipart requests (file uploads via queries and mutations) to various Node.js GraphQL servers.
Stars: ✭ 1,071 (+1190.36%)
Mutual labels: express, koa
Koa2 Api Scaffold
一个基于Koa2的轻量级RESTful API Server脚手架。
Stars: ✭ 694 (+736.14%)
Mutual labels: express, koa
Angela
🙂angela (安其拉):react ssr router redux; react同构框架
Stars: ✭ 15 (-81.93%)
Mutual labels: express, koa
Deprecated
🚀 Framework for building universal web app and static website in Vue.js (beta)
Stars: ✭ 858 (+933.73%)
Mutual labels: express, koa
Trafficlight
🚦 Flexible NodeJS Routing Decorators for API Routing
Stars: ✭ 69 (-16.87%)
Mutual labels: express, koa
Openapi Backend
Build, Validate, Route, Authenticate and Mock using OpenAPI
Stars: ✭ 216 (+160.24%)
Mutual labels: express, koa
Cool Admin Api
cool-admin-api 是基于egg.js、typeorm、jwt等封装的api开发脚手架、快速开发api接口
Stars: ✭ 188 (+126.51%)
Mutual labels: express, koa
Cabin
🌲 Cabin is the best JavaScript and Node.js logging service and logging npm package
Stars: ✭ 622 (+649.4%)
Mutual labels: express, koa
Cls Rtracer
Request Tracer - CLS-based request id generation for Express, Fastify, Koa and Hapi, batteries included
Stars: ✭ 175 (+110.84%)
Mutual labels: express, koa
Kona
a node.js service framework built on koa.js (generators)
Stars: ✭ 23 (-72.29%)
Mutual labels: express, koa
Vue Socket.io Chat
💬 TypeScript + Vue + Express/Koa + Socket.io
Stars: ✭ 61 (-26.51%)
Mutual labels: express, koa
redux, express, koa 中间件实现对比分析
这里是示例代码,简单模拟了 redux, express, koa的执行流程,剥离出了中间件的核心实现,尽量保留原始结构和主流程,去掉异常处理,完整性校验,辅助工具等干扰代码,更方便的帮助理解中间件的执行过程。
说明
src
中分别是express
, koa
, redux
的模拟实现
test
文件夹中是三者的使用实例
运行
npm install
后直接对应运行test
目录下的文件即可,然后查看控制台输出
express
运行 node tests/express.spec.js
访问 http: 127.0.0.1: 3000
查看控制台输出
express
test 文件中有部分注释代码,用于演示 async
函数作为中间件,可以自行打开注释运行查看
koa
运行 node tests/koa.spec.js
访问 http: 127.0.0.1: 3000
查看控制台输出
redux
运行 node tests/redux.spec.js
查看控制台输出
每个 test 文件里面都可以替换为真正的 express
, koa
, redux
对比运行效果
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].