aboutsummaryrefslogtreecommitdiff
path: root/examples/hono/src
diff options
context:
space:
mode:
authorGravatar Jesse-Lucas1996 <61496789+Jesse-Lucas1996@users.noreply.github.com> 2022-07-12 17:46:22 +0800
committerGravatar GitHub <noreply@github.com> 2022-07-12 11:46:22 +0200
commita63a0ccc105039278faaf920940ffa737e9b98df (patch)
tree5b5b5a4a637a1b3e232571c8bbe6bd65c639e582 /examples/hono/src
parent734775e4100fce92961a6f8dd6a8fd0ea45a68eb (diff)
downloadbun-a63a0ccc105039278faaf920940ffa737e9b98df.tar.gz
bun-a63a0ccc105039278faaf920940ffa737e9b98df.tar.zst
bun-a63a0ccc105039278faaf920940ffa737e9b98df.zip
docs: Hono example with typescript (#577)
* hono example with typescript * changing of name in package json * adding dom to lib * removal of git ignore * removed DOM * Update examples/hono/src/index.ts Co-authored-by: Hyro <generalkubo@gmail.com> * changed port * added read me * Update index.ts * Update package.json * Update readme.md Co-authored-by: Hyro <generalkubo@gmail.com> Co-authored-by: Jesse Lucas <jlucas@corpcloud.com.au> Co-authored-by: Finn R. Gärtner <65015656+FinnRG@users.noreply.github.com>
Diffstat (limited to 'examples/hono/src')
-rw-r--r--examples/hono/src/index.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/examples/hono/src/index.ts b/examples/hono/src/index.ts
new file mode 100644
index 000000000..2bc0be21c
--- /dev/null
+++ b/examples/hono/src/index.ts
@@ -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,
+};