diff options
author | 2022-07-12 17:46:22 +0800 | |
---|---|---|
committer | 2022-07-12 11:46:22 +0200 | |
commit | a63a0ccc105039278faaf920940ffa737e9b98df (patch) | |
tree | 5b5b5a4a637a1b3e232571c8bbe6bd65c639e582 /examples/hono/src | |
parent | 734775e4100fce92961a6f8dd6a8fd0ea45a68eb (diff) | |
download | bun-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.ts | 16 |
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, +}; |