Skip to content

Commit

Permalink
feat: support hono (#1890)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait authored Jul 17, 2024
1 parent fd06983 commit 0f9f398
Show file tree
Hide file tree
Showing 11 changed files with 1,073 additions and 204 deletions.
3 changes: 2 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"deoptimize",
"etag",
"cachable",
"finalhandler"
"finalhandler",
"hono"
],
"ignorePaths": [
"CHANGELOG.md",
Expand Down
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -624,8 +624,8 @@ app.listen(3000, () => console.log("Example app listening on port 3000!"));
```js
const Koa = require("koa");
const webpack = require("webpack");
const webpackConfig = require("./test/fixtures/webpack.simple.config");
const middleware = require("./dist");
const webpackConfig = require("./webpack.simple.config");
const middleware = require("webpack-dev-middleware");

const compiler = webpack(webpackConfig);
const devMiddlewareOptions = {
Expand Down Expand Up @@ -694,6 +694,27 @@ const devMiddlewareOptions = {
})();
```

### Hono

```js
import webpack from "webpack";
import { serve } from "@hono/node-server";
import { Hono } from "hono";
import devMiddleware from "webpack-dev-middleware";
import webpackConfig from "./webpack.config.js";

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

const app = new Hono();

app.use(devMiddleware.honoWrapper(compiler, devMiddlewareOptions));

serve(app);
```

## Contributing

Please take a moment to read our contributing guidelines if you haven't yet done so.
Expand Down
20 changes: 20 additions & 0 deletions package-lock.json

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

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"@commitlint/config-conventional": "^19.0.3",
"@fastify/express": "^2.3.0",
"@hapi/hapi": "^21.3.7",
"@hono/node-server": "^1.12.0",
"@types/connect": "^3.4.35",
"@types/express": "^4.17.13",
"@types/mime-types": "^2.1.1",
Expand All @@ -90,6 +91,7 @@
"fastify": "^4.26.2",
"file-loader": "^6.2.0",
"finalhandler": "^1.2.0",
"hono": "^4.4.13",
"husky": "^9.0.10",
"jest": "^29.3.1",
"joi": "^17.12.2",
Expand Down
Loading

0 comments on commit 0f9f398

Please sign in to comment.