Commit 0e9932d9 authored by Kim, Hyeonseo's avatar Kim, Hyeonseo
Browse files

docs: update elysia integration

parent 435c256a
Loading
Loading
Loading
Loading
+35 −0
Original line number Diff line number Diff line
@@ -520,3 +520,38 @@ object can handle.

[`Request`]: https://developer.mozilla.org/en-US/docs/Web/API/Request
[`Response`]: https://developer.mozilla.org/en-US/docs/Web/API/Response


ElysiaJS
--------

*This API is available since Fedify 1.8.0.*

[ElysiaJS] is an ergonomic framework designed for humans, featuring built-in TypeScript support with end-to-end type safety, type integrity, and an exceptional developer experience. Powered by Bun, it delivers high performance and modern tooling. The @fedify/elysia package provides a seamless plugin for integrating Fedify with Elysia:

elysia:



::: code-group
~~~~ sh [Bun]
bun add @fedify/elysia
~~~~
:::


~~~~ typescript
import { fedify } from "@fedify/elysia";
import { federation } from "./federation.ts";  // Your `Federation` instance
import { Elysia } from "elysia";

const app = new Elysia();

app
  .use(fedify(federation, () => "context data goes here"))
  .listen(3000);

console.log("Elysia App Start!");
~~~~

[ElysiaJS]: https://elysiajs.com/
+27 −12
Original line number Diff line number Diff line
# Elysia with Bun runtime
Fedify–Express integration example
==================================

## Getting Started
To get started with this template, simply paste this command into your terminal:
```bash
bun create elysia ./elysia-example
```
This is a simple example of how to integrate Fedify into an [ElysiaJS]
application.

## Development
To start the development server run:
```bash
bun run dev
```
[Express]: https://elysiajs.com/

Open http://localhost:3000/ with your browser to see the result.
 No newline at end of file

Running the example
-------------------

 1. Clone the repository:

    ~~~~ sh
    git clone https://github.com/fedify-dev/fedify.git
    cd fedify/examples/elysia
    ~~~~

 2. Install dependencies:

    ~~~~ sh
    bun install
    ~~~~

 3. Start the server:

    ~~~~ sh
    bun start
    ~~~~
+32 −12
Original line number Diff line number Diff line
# Elysia with Bun runtime
<!-- deno-fmt-ignore-file -->

## Getting Started
To get started with this template, simply paste this command into your terminal:
```bash
bun create elysia ./elysia-example
```
@fedify/express: Integrate Fedify with Express
==============================================

## Development
To start the development server run:
```bash
bun run dev
```
[![npm][npm badge]][npm]
[![Matrix][Matrix badge]][Matrix]
[![Follow @fedify@hollo.social][@fedify@hollo.social badge]][@fedify@hollo.social]

Open http://localhost:3000/ with your browser to see the result.
 No newline at end of file
This package provides a simple way to integrate [Fedify] with [Express].

The integration code looks like this:

~~~~ typescript
import { fedify } from "@fedify/elysia";
import { federation } from "./federation.ts";  // Your `Federation` instance
import { Elysia } from "elysia";

const app = new Elysia();

app
  .use(fedify(federation, () => "context data goes here"))
  .listen(3000);

console.log("Elysia App Start!");
~~~~

[npm]: https://www.npmjs.com/package/@fedify/elysia
[npm badge]: https://img.shields.io/npm/v/@fedify/express?logo=npm
[Matrix]: https://matrix.to/#/#fedify:matrix.org
[Matrix badge]: https://img.shields.io/matrix/fedify%3Amatrix.org
[@fedify@hollo.social badge]: https://fedi-badge.deno.dev/@fedify@hollo.social/followers.svg
[@fedify@hollo.social]: https://hollo.social/@fedify
[Fedify]: https://fedify.dev/
[Express]: https://expressjs.com/