Route Handler Proxy
Forward client requests through App Router endpoints while the backend URL stays server-side.
A runnable Next.js 15 project that implements every published `@pajarrahmansyah/passit` feature through App Router route handlers.
8
demo routes
3
services
2
adapters
Basic proxy
/api/basic?_limit=3
Ready to send
Select a PassIt route and run it to inspect the normalized response.Forward client requests through App Router endpoints while the backend URL stays server-side.
Switch between JSONPlaceholder, httpbin, and an axios-backed service by key.
Add static config headers and route-level headers without exposing API keys.
Set global defaults and override retry behavior per route for server errors.
Wrap success and error responses into a consistent shape for frontend consumers.
Map backend payloads into the exact contract your app wants to render.
Use request, response, and error hooks for development logs or production observability.
Exercise the default fetch adapter and the optional axios adapter in one demo app.
export default defineConfig({
json: {
baseUrl: "https://jsonplaceholder.typicode.com",
http: "fetch",
headers: { "x-passit-app": "nextjs-15-example" },
timeout: 5000,
normalize: { success: true, error: true },
},
axiosJson: {
baseUrl: "https://jsonplaceholder.typicode.com",
http: "axios",
normalize: true,
},
})export async function GET(req: NextRequest) {
return passIt({
service: "json",
path: "/posts",
req,
normalize: false,
response: (posts) => ({
count: posts.length,
preview: posts.slice(0, 5),
}),
})
}