Skip to content

Commit

Permalink
feat: koa support (#1792)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Mar 27, 2024
1 parent b3f9126 commit 458c17c
Show file tree
Hide file tree
Showing 8 changed files with 585 additions and 296 deletions.
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,25 @@ app.use(devMiddleware(compiler, devMiddlewareOptions));
app.listen(3000, () => console.log("Example app listening on port 3000!"));
```

### Koa

```js
const Koa = require("koa");
const webpack = require("webpack");
const webpackConfig = require("./test/fixtures/webpack.simple.config");
const middleware = require("./dist");

const compiler = webpack(webpackConfig);
const devMiddlewareOptions = {
/** Your webpack-dev-middleware-options */
};
const app = new Koa();

app.use(middleware.koaWrapper(compiler, devMiddlewareOptions));

app.listen(3000);
```

### Hapi

```js
Expand Down Expand Up @@ -613,10 +632,6 @@ process.on("unhandledRejection", (err) => {
});
```

### Koa

Soon...

### Fastify

Fastify interop will require the use of `fastify-express` instead of `middie` for providing middleware support. As the authors of `fastify-express` recommend, this should only be used as a stopgap while full Fastify support is worked on.
Expand Down
224 changes: 224 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"husky": "^9.0.10",
"jest": "^29.3.1",
"joi": "^17.12.2",
"koa": "^2.15.2",
"lint-staged": "^15.2.0",
"npm-run-all": "^4.1.5",
"prettier": "^3.2.4",
Expand Down

0 comments on commit 458c17c

Please sign in to comment.