From 0ecd773081c8254474b8c756887d19409aa13090 Mon Sep 17 00:00:00 2001 From: Colin McDonnell Date: Fri, 24 Feb 2023 17:48:49 -0800 Subject: [PATCH] Docs (#2170) * Add hono and elysia * Update elysia and add coming soon * Fix typo * Add back awesome --- docs/ecosystem/elysia.md | 21 +++++++++++++++++++++ docs/ecosystem/hono.md | 17 +++++++++++++++++ docs/nav.ts | 16 ++++++++++++++-- 3 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 docs/ecosystem/elysia.md create mode 100644 docs/ecosystem/hono.md diff --git a/docs/ecosystem/elysia.md b/docs/ecosystem/elysia.md new file mode 100644 index 0000000000..d011e3f0c1 --- /dev/null +++ b/docs/ecosystem/elysia.md @@ -0,0 +1,21 @@ +[Elysia](https://elysiajs.com) is a Bun-first web framework that takes full advantage of Bun's HTTP, file system, and hot reloading APIs. + +```ts#server.ts +import { Elysia } from 'elysia' + +const app = new Elysia() + .get('/', () => 'Hello Elysia') + .listen(8080) + +console.log(`🦊 Elysia is running at on port ${app.server.port}...`) +``` + +Get started with `bun create`. + +```bash +$ bun create elysia ./myapp +$ cd myapp +$ bun run dev +``` + +Refer to the Elysia [documentation](https://elysiajs.com/quick-start.html) for more information. \ No newline at end of file diff --git a/docs/ecosystem/hono.md b/docs/ecosystem/hono.md new file mode 100644 index 0000000000..d63975e48a --- /dev/null +++ b/docs/ecosystem/hono.md @@ -0,0 +1,17 @@ +[Hono](https://github.com/honojs/hono) is a lightwaight ultrafast web framework designed for the edge. + +```ts +import { Hono } from 'hono' +const app = new Hono() + +app.get('/', (c) => c.text('Hono!')) + +export default app +``` + +Get started with `bun create` or follow Hono's [Bun quickstart](https://hono.dev/getting-started/bun). +```bash +$ bun create hono ./myapp +$ cd myapp +$ bun run start +``` diff --git a/docs/nav.ts b/docs/nav.ts index 3feebba66c..4c05a4368b 100644 --- a/docs/nav.ts +++ b/docs/nav.ts @@ -7,19 +7,23 @@ export type NavPage = { type: "page"; slug: string; title: string; + disabled?: boolean; + href?: string; }; type NavDivider = { type: "divider"; title: string; }; -function page(slug: string, title: string): NavPage { - return { type: "page", slug, title }; + +function page(slug: string, title: string, props?: {disabled?: boolean; href?: string}): NavPage { + return { type: "page", slug, title, ...props }; } function divider(title: string): NavDivider { return { type: "divider", title }; } + export default { items: [ divider("Intro"), @@ -34,6 +38,8 @@ export default { page("cli/test", "`bun test`"), page("cli/create", "`bun create`"), page("cli/bunx", "`bunx`"), + page("cli/deploy", "`bun deploy`", {disabled: true}), + // page("bundler", "Bundler"), // page("cli/bun-install", "`bun install`"), // page("cli/bun-create", "`bun create`"), @@ -51,6 +57,7 @@ export default { page("runtime/hot", "Hot reloading"), // page("runtime/loaders", "Loaders"), page("runtime/plugins", "Plugins"), + page("runtime/framework", "Framework API", {disabled: true}), // page("runtime/nodejs", "Node.js APIs"), divider("Ecosystem"), @@ -58,6 +65,11 @@ export default { page("ecosystem/typescript", "TypeScript"), page("ecosystem/react", "React"), page("ecosystem/express", "Express"), + page("ecosystem/hono", "Hono"), + page("ecosystem/elysia", "Elysia"), + page("ecosystem/awesome", "Awesome", { + href:"https://github.com/apvarun/awesome-bun" + }), divider("API"), page("api/http", "HTTP"), // "`Bun.serve`"),