{"id":17802694,"url":"https://github.com/stefee/fastify-next","last_synced_at":"2025-03-17T11:31:05.732Z","repository":{"id":50587124,"uuid":"519536470","full_name":"stefee/fastify-next","owner":"stefee","description":"Fastify plugin for serving Next.js pages","archived":true,"fork":false,"pushed_at":"2025-01-16T21:20:47.000Z","size":318,"stargazers_count":3,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-04T14:01:57.508Z","etag":null,"topics":["fastify","fastify-plugin","next","react","ssr"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/fastify-next","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stefee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-30T14:21:44.000Z","updated_at":"2025-01-17T11:39:14.000Z","dependencies_parsed_at":"2023-02-15T19:31:02.629Z","dependency_job_id":"e6e0d877-fbda-4cd4-ab43-e7894ce4b5bd","html_url":"https://github.com/stefee/fastify-next","commit_stats":{"total_commits":107,"total_committers":2,"mean_commits":53.5,"dds":"0.23364485981308414","last_synced_commit":"42e1c1574453634f7196fcd9c3370dcb49525bf5"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefee%2Ffastify-next","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefee%2Ffastify-next/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefee%2Ffastify-next/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stefee%2Ffastify-next/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stefee","download_url":"https://codeload.github.com/stefee/fastify-next/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243048123,"owners_count":20227592,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fastify","fastify-plugin","next","react","ssr"],"created_at":"2024-10-27T12:44:17.529Z","updated_at":"2025-03-17T11:31:05.119Z","avatar_url":"https://github.com/stefee.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# fastify-next\n\nFastify plugin for [Next.js](https://nextjs.org/), the React framework.\n\nThis is an alternative to the official [@fastify/nextjs](https://github.com/fastify/fastify-nextjs) plugin. See [comparison](#comparison-with-fastifynextjs).\n\n## Install\n\n```\nnpm install fastify-next next react react-dom\n```\n\n## Basic Usage\n\nIf you want your Fastify server to work similar to the Next.js CLI, do the following:\n\n```ts\nimport fastify from 'fastify';\nimport FastifyNext from 'fastify-next';\n\n// Registering the plugin adds the 'next' decorator\nawait fastify.register(FastifyNext);\n\n// Pass '*' to handle all incoming requests with Next.js\nfastify.next('*');\n```\n\n## Comparison with @fastify/nextjs\n\nFor the most part, this package will work as a drop-in replacement for [@fastify/nextjs](https://github.com/fastify/fastify-nextjs). However, there are a few differences.\n\n### `_next/*` route handling\n\nBy default **@fastify/nextjs** handles all incoming requests to `/_next/*`. To mimic this behaviour with **fastify-next**, add the following:\n\n```ts\nfastify.next('/_next/*');\n```\n\n### under-pressure\n\nThe **@fastify/nextjs** plugin includes [under-pressure](https://www.npmjs.com/package/under-pressure) as a dependency which can be enabled by passing the `underPressure: true` option. This package does not currently include support for under-pressure.\n\n### Startup time during local dev\n\nNext.js type-checks and compiles the application when the dev server first starts. The **@fastify/nextjs** plugin waits for the Next.js server to finish doing this before resolving plugin initialization. This can lead to [plugin timeout](https://www.fastify.io/docs/latest/Reference/Server/#plugintimeout) in [large Next.js projects](https://github.com/fastify/fastify-nextjs#plugin-timeout-and-nextjs-development-mode).\n\nThis plugin initializes **immediately**, allowing you to make requests to the Fastify server immediately, but will wait for Next.js to complete startup before handling incoming requests.\n\nNote: this has **no effect in production**. The dev server can be enabled using the `dev: true` option or setting `NODE_ENV=development` in the environment.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefee%2Ffastify-next","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstefee%2Ffastify-next","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstefee%2Ffastify-next/lists"}