Add Next.js App Router and Pages Router integration for health checks#155
Add Next.js App Router and Pages Router integration for health checks#155Copilot wants to merge 7 commits into
Conversation
Co-authored-by: arthurfiorette <47537704+arthurfiorette@users.noreply.github.com>
Co-authored-by: arthurfiorette <47537704+arthurfiorette@users.noreply.github.com>
Co-authored-by: arthurfiorette <47537704+arthurfiorette@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #155 +/- ##
==========================================
+ Coverage 98.21% 98.41% +0.20%
==========================================
Files 14 15 +1
Lines 1064 1264 +200
Branches 75 82 +7
==========================================
+ Hits 1045 1244 +199
- Misses 13 14 +1
Partials 6 6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@copilot i fixed the docs for you, now:
|
…ance param, add headers option Co-authored-by: arthurfiorette <47537704+arthurfiorette@users.noreply.github.com>
Done! ✅ (cad2db8) Changes made:
All 35 tests passing with 100% code coverage on the integration. |
Adds Next.js health check integration supporting both App Router (Next.js 13+) and Pages Router, enabling seamless health check endpoints in Next.js applications.
Changes
Integration (
src/integrations/nextjs.ts)createNextHealthCheckHandler: Primary handler for Next.js App Router (usesNextRequest/NextResponse)createNextPagesHealthCheckHandler: Handler for legacy Pages Router (usesNextApiRequest/NextApiResponse)debug,last,simulatenext@>=13.0.0(req) => boolean | Promise<boolean>for conditional debug output based on authentication or other request propertiesMedicusOption(consistent with other integrations)DefaultHttpHeadersconstant from HTTP integrationTests (
test/integrations/nextjs.test.ts)Documentation (
docs/integrations/nextjs.md)Usage
App Router (Recommended)
Pages Router (Legacy)
Both endpoints support
/api/health?debug=true&last=true&simulate=unhealthyfor testing and debugging.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.