Vollständige Next.js 15 Portfolio-Website mit: - Blog-System mit 100+ Artikeln - Supabase-Integration - Responsive Design mit Tailwind CSS - TypeScript-Konfiguration - Testing-Setup mit Vitest und Playwright Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
26 lines
695 B
TypeScript
26 lines
695 B
TypeScript
import { createServerClient } from '@supabase/ssr';
|
|
import { NextRequest, NextResponse } from 'next/server';
|
|
|
|
export function createClient(request: NextRequest, response: NextResponse) {
|
|
return createServerClient(
|
|
process.env.NEXT_PUBLIC_SUPABASE_URL!,
|
|
process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
|
|
{
|
|
cookies: {
|
|
getAll() {
|
|
return request.cookies.getAll();
|
|
},
|
|
setAll(cookiesToSet) {
|
|
try {
|
|
cookiesToSet.forEach(({ name, value, options }) => {
|
|
response.cookies.set(name, value, options);
|
|
});
|
|
} catch {
|
|
// Handle middleware context
|
|
}
|
|
},
|
|
},
|
|
}
|
|
);
|
|
}
|