diff options
author | 2022-07-25 05:51:41 +0900 | |
---|---|---|
committer | 2022-07-24 22:51:41 +0200 | |
commit | 78963610848c88106d31d91def27f27d2560ea0c (patch) | |
tree | 703a70deb76daf27f5792385298609e8622e2901 /examples/hono/src/index.ts | |
parent | bdf6b3e31211d55532c5f5c01cea228b1d6133ef (diff) | |
download | bun-78963610848c88106d31d91def27f27d2560ea0c.tar.gz bun-78963610848c88106d31d91def27f27d2560ea0c.tar.zst bun-78963610848c88106d31d91def27f27d2560ea0c.zip |
chores(examples/hono): Refine Hono example (#773)
* fixed path
* add favicon
* Correct version: `^2.0.0`
* remove wiptest command
Diffstat (limited to 'examples/hono/src/index.ts')
-rw-r--r-- | examples/hono/src/index.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/hono/src/index.ts b/examples/hono/src/index.ts index 145bd5db0..801955af3 100644 --- a/examples/hono/src/index.ts +++ b/examples/hono/src/index.ts @@ -1,10 +1,13 @@ import { Hono } from "hono"; +import { serveStatic } from 'hono/serve-static.bun'; + +const port = parseInt(process.env.PORT) || 3000; const app = new Hono(); -const port = parseInt(process.env.PORT) || 3000; +app.use('/favicon.ico', serveStatic({ path: './public/favicon.ico' })); -const home = app.get("/", (c) => { +app.get("/", (c) => { return c.json({ message: "Hello World!" }); }); @@ -12,5 +15,5 @@ console.log(`Running at http://localhost:${port}`); export default { port, - fetch: home.fetch, + fetch: app.fetch }; |