All Projects → kaelzhang → express-to-koa

kaelzhang / express-to-koa

Licence: other
Use express middlewares in Koa2, the one that really works.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to express-to-koa

Cool Admin Api
cool-admin-api 是基于egg.js、typeorm、jwt等封装的api开发脚手架、快速开发api接口
Stars: ✭ 188 (+944.44%)
Mutual labels:  koa, koa2
koa-mongoDB
😊😊Koa and mongoose build services
Stars: ✭ 24 (+33.33%)
Mutual labels:  koa, koa2
Egg Core
A core Pluggable framework based on koa.
Stars: ✭ 194 (+977.78%)
Mutual labels:  koa, koa2
Koa Hbs
Handlebars templates for Koa.js
Stars: ✭ 156 (+766.67%)
Mutual labels:  koa, koa2
koa2-proxy
基于koa@next的代理工具,支持http和https,并且可以当做本地服务器使用
Stars: ✭ 42 (+133.33%)
Mutual labels:  koa, koa2
Github Ranking
🔍GitHub不同语言热门项目排行,Vue.js做页面展示
Stars: ✭ 160 (+788.89%)
Mutual labels:  koa, koa2
Strapi Sdk Javascript
🔌 Official JavaScript SDK for APIs built with Strapi.
Stars: ✭ 247 (+1272.22%)
Mutual labels:  koa, koa2
Koalerplate
Simple Koa Boilerplate for APIs
Stars: ✭ 118 (+555.56%)
Mutual labels:  koa, koa2
koahub-cli
KoaHub CLI -- KoaHub.js的开发工具,自动babel编译 ES6/7(Generator Function, Class, Async & Await)并且文件修改后自动重启。
Stars: ✭ 16 (-11.11%)
Mutual labels:  koa, koa2
nodejs-koa-blog
基于 Node.js Koa2 实战开发的一套完整的博客项目网站
Stars: ✭ 1,611 (+8850%)
Mutual labels:  koa, koa2
Vue Webpack Config
Koa2、Webpack、Vue、React、Node
Stars: ✭ 151 (+738.89%)
Mutual labels:  koa, koa2
koa2-swagger-ui
Swagger UI as Koa v2 middleware
Stars: ✭ 95 (+427.78%)
Mutual labels:  koa, koa2
Sactive Web
🚀 A dependency injection web framework for Node.js.
Stars: ✭ 143 (+694.44%)
Mutual labels:  koa, koa2
Blog Service
blog service @nestjs
Stars: ✭ 188 (+944.44%)
Mutual labels:  koa, koa2
Koa Proxies
a [email protected] proxy middleware
Stars: ✭ 125 (+594.44%)
Mutual labels:  koa, koa2
Koa Webpack Middleware
webpack dev&hot middleware for koa2
Stars: ✭ 215 (+1094.44%)
Mutual labels:  koa, koa2
Strapi
🚀 Open source Node.js Headless CMS to easily build customisable APIs
Stars: ✭ 41,786 (+232044.44%)
Mutual labels:  koa, koa2
Postgraphile
GraphQL is a new way of communicating with your server. It eliminates the problems of over- and under-fetching, incorporates strong data types, has built-in introspection, documentation and deprecation capabilities, and is implemented in many programming languages. This all leads to gloriously low-latency user experiences, better developer experiences, and much increased productivity. Because of all this, GraphQL is typically used as a replacement for (or companion to) RESTful API services.
Stars: ✭ 10,967 (+60827.78%)
Mutual labels:  koa, koa2
koa-xml-body
koa middleware to parse xml request body
Stars: ✭ 36 (+100%)
Mutual labels:  koa, koa2
node-typescript-starter
REST API using Node with typescript, KOA framework. TypeORM for SQL. Middlewares JWT (auth), CORS, Winston Logger, Error, Response
Stars: ✭ 19 (+5.56%)
Mutual labels:  koa, koa2

Build Status Coverage

express-to-koa

Use express middlewares in Koa2 (not support koa1 for now), the one that REALLY WORKS.

  • Handle koa2 http status code, which fixes the common issue that we always get 404 with koa-connect
  • Handle express middlewares that contains .pipe(res), such as express.static which based on send

Usage

const e2k = require('express-to-koa')

// Some express middleware
const devMiddleware = require('webpack-dev-middleware')(compiler, {
  publicPath,
  quiet: true
})

const app = new Koa()
app.use(e2k(devMiddleware))

What Kind of Express Middlewares are Supported?

NEARLY ALL express middlewares built with best practices.

TL;NR

express-to-koa does not support all arbitrary express middlewares, but only for those who only uses Express-Independent APIs like res.write and res.end, i.e. the APIs that node http.ServerResponse provides.

However, if a middleware uses APIs like res.send or something, express-to-koa will do far too much work to convert those logic to koa2, which is not easier than creating both express and koa2 from 0 to 1.

So, it is a good practice to write framework-agnostic middlewares or libraries.

Supported Middlewares

License

MIT

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].