Skip to content

Commit d9a19b7

Browse files
committed
Initial commit (via bun create)
0 parents  commit d9a19b7

File tree

5 files changed

+64
-0
lines changed

5 files changed

+64
-0
lines changed

package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"version": "1.0.103",
3+
"name": "threads-api",
4+
"devDependencies": {
5+
"bun-types": "latest"
6+
},
7+
"dependencies": {
8+
"hono": "^2.2.5"
9+
},
10+
"scripts": {
11+
"start": "bun run src/index.ts"
12+
},
13+
"module": "src/index.js"
14+
}

public/favicon.ico

15 KB
Binary file not shown.

readme.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Hono with Bun runtime
2+
3+
## Getting Started
4+
5+
### Cloning the repo
6+
7+
```sh
8+
bun create hono ./NAME_HERE
9+
```
10+
11+
### Development
12+
13+
```
14+
bun run start
15+
```
16+
17+
Open http://localhost:3000 with your browser to see the result.
18+
19+
### For more information
20+
21+
See <https://honojs.dev/>

src/index.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Hono } from "hono";
2+
import { serveStatic } from "hono/serve-static.bun";
3+
4+
const port = parseInt(process.env.PORT) || 3000;
5+
6+
const app = new Hono();
7+
8+
app.use("/favicon.ico", serveStatic({ path: "./public/favicon.ico" }));
9+
10+
app.get("/", (c) => {
11+
return c.json({ message: "Hello World!" });
12+
});
13+
14+
console.log(`Running at http://localhost:${port}`);
15+
16+
export default {
17+
port,
18+
fetch: app.fetch,
19+
};

tsconfig.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"compilerOptions": {
3+
"lib": ["ESNext"],
4+
"module": "esnext",
5+
"target": "esnext",
6+
"moduleResolution": "node",
7+
// "bun-types" is the important part
8+
"types": ["bun-types"]
9+
}
10+
}

0 commit comments

Comments
 (0)