Skip to content

feat: support hono #1890

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading