Unverified Commit 9dd4221c authored by Hong Minhee's avatar Hong Minhee
Browse files

Merge pull request #387 from 2chanhaeng/main

parents 2ae57cf6 2ff7aa0b
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,
+11 −0
Original line number Diff line number Diff line
@@ -490,6 +490,16 @@ Next.js

*This API is available since Fedify 1.9.0.*

> [!TIP]
> 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`
module that provides a middleware to integrate Fedify with Next.js.  Create
@@ -646,5 +656,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
+1 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ added in the future.[^1]
     software](https://github.com/fedify-dev/hollo)
  -  [Hono integration sample](./hono-sample/)
  -  [Fedify–Express integration example](./express/)
  -  [Fedify–Next.js integration example using `@fedify/next`](./next-integration/)
  -  [Fedify–Next.js 14 integration example](./next14-app-router/)
  -  [Fedify–Next.js 15 integration example](./next15-app-router/)
  -  [Fedify on Cloudflare Workers example](./cloudflare-workers/)
+41 −0
Original line number Diff line number Diff line
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# env files (can opt-in for committing if needed)
.env*

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
+45 −0
Original line number Diff line number Diff line
Fedify–Next.js integration example
==================================

`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
-------------------

1.  Clone the repository:

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

2.  Install dependencies:

    ~~~~ sh
    pnpm i
    ~~~~

3.  Start the server:

    ~~~~ 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
    `@demo@6c10b40c63d9e1ce7da55667ef0ef8b4.serveo.net`.

5.  Access https://activitypub.academy/ and search your handle and follow.

6.  You can see following list like:

    ~~~~
    This account has the below 1 followers:
    https://activitypub.academy/users/beboes_bedoshs
    ~~~~
Loading