Commit 2ff7aa0b authored by ChanHaeng Lee's avatar ChanHaeng Lee
Browse files

Format docs

parent 4d5fb01b
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -4,6 +4,9 @@
  "editor.detectIndentation": false,
  "editor.indentSize": 2,
  "editor.insertSpaces": true,
  "editor.rulers": [
    80
  ],
  "files.eol": "\n",
  "files.insertFinalNewline": true,
  "files.trimFinalNewlines": true,
+9 −5
Original line number Diff line number Diff line
@@ -486,11 +486,14 @@ Next.js
*This API is available since Fedify 1.9.0.*

> [!TIP]
> You can see the example in the `examples/next-integration` directory.
> Or you can just create a Fedify–Next.js app with the following command!:
> ```sh
> npx create-next-app -e https://github.com/fedify-dev/fedify --example-path examples/next-integration
> ```
> You can see the example in the `examples/next-integration` directory in
> the [Fedify repository].
> Or you can just create a Fedify–Next.js app with the following command:
> 
> ~~~~ sh
> npx create-next-app -e https://github.com/fedify-dev/fedify \
>   --example-path examples/next-integration
> ~~~~

[Next.js] is a React framework that enables you to build server-rendered
and statically generated web applications.  Fedify has the `@fedify/next`
@@ -648,5 +651,6 @@ as [`Request`] and [`Response`] objects. In that case, you need to convert
the request and response objects to the appropriate types that the `Federation`
object can handle.

[Fedify repository]: https://github.com/fedify-dev/fedify
[`Request`]: https://developer.mozilla.org/en-US/docs/Web/API/Request
[`Response`]: https://developer.mozilla.org/en-US/docs/Web/API/Response
+14 −11
Original line number Diff line number Diff line
# Fedify–Next.js integration example
Fedify–Next.js integration example
==================================

## `create-next-app`
`create-next-app`
-----------------

If you created Fedify–Next.js app with `create-next-app` and
`-e https://github.com/fedify-dev/fedify --example-path examples/next-integration`
option, you should fix `@fedify/fedify` and `@fedify/next` packages version
to `^1.9.0` from `:workspace` in [`package.json`](./package.json).

## Running the Example
Running the Example
-------------------

1.  Clone the repository:

    ```sh
    ~~~~ sh
    git clone https://github.com/fedify-dev/fedify.git
    cd fedify/examples/next-integration
    ```
    ~~~~

2.  Install dependencies:

    ```sh
    ~~~~ sh
    pnpm i
    ```
    ~~~~

3.  Start the server:

    ```sh
    ~~~~ sh
    pnpm dev & pnpx @fedify/cli tunnel 3000
    ```
    ~~~~

4.  Open your browser tunneled URL and start interacting with the app.
    You can see your handle such as
@@ -36,7 +39,7 @@ to `^1.9.0` from `:workspace` in [`package.json`](./package.json).

6.  You can see following list like:

    ```
    ~~~~
    This account has the below 1 followers:
    https://activitypub.academy/users/beboes_bedoshs
    ```
    ~~~~
+2 −1
Original line number Diff line number Diff line
@@ -3,9 +3,10 @@
 * ===================
 *
 * This module provides a [Next.js] middleware to integrate with the Fedify.
 * You can see the example in `examples/next-integration`.
 * You can see the example in `examples/next-integration` of the [Fedify repository].
 *
 * [Next.js]: https://nextjs.org/
 * [Fedify repository]: https://github.com/fedify-dev/fedify/
 *
 * @module
 * @since 1.9.0