Skip to content
14 changes: 14 additions & 0 deletions examples/hono/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": "1.0.0",
"name": "hono",
"main": "src/index.js",
"devDependencies": {
"bun-types": "^0.0.83"
},
"dependencies": {
"hono": "^1.6.4"
},
"scripts": {
"start": "bun run src/index.ts"
}
}
17 changes: 17 additions & 0 deletions examples/hono/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Hono with Bun runtime

## Getting Started

### Cloning the repo

```sh
bun create hono ./NAME_HERE
```

### Development
```
bun run start
```

Open http://localhost:3000 with your browser to see the result.

16 changes: 16 additions & 0 deletions examples/hono/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Hono } from "hono";

const app = new Hono();

const port = process.env.PORT || 3000;

const home = app.get("/", (c) => {
return c.json({ message: "Hello World!" });
});

console.log(`Running at http://localhost:${port}`);

export default {
port: process.env.PORT || 3000,
fetch: home.fetch,
};
10 changes: 10 additions & 0 deletions examples/hono/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"lib": ["ESNext"],
"module": "esnext",
"target": "esnext",
"moduleResolution": "node",
// "bun-types" is the important part
"types": ["bun-types"]
}
}