mirror of
https://github.com/bitbaum/botsmann.git
synced 2026-12-04 11:58:23 +01:00
- Add /api/quick-chat endpoint for professional chat demos - Add /create page for building custom bots - Add /enterprise page for B2B landing - Add /my-data page for user document management - Add /personal page for memorial/companion bots - Add demo components (DemoSection, DemoChat, DemoIntake, etc.) - Add shared components (HowItWorks, PrivacySection, EnterpriseSection) - Add bot templates and demo configurations These files enable the professional demo chats and the full platform experience with custom bot creation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
19 lines
507 B
TypeScript
19 lines
507 B
TypeScript
import type { NextRequest } from 'next/server';
|
|
|
|
// Extract a best-effort client IP for rate limiting and logging
|
|
export function getClientIp(req: NextRequest): string {
|
|
const xff = req.headers.get('x-forwarded-for');
|
|
if (xff) {
|
|
const first = xff.split(',')[0]?.trim();
|
|
if (first) return first;
|
|
}
|
|
const realIp = req.headers.get('x-real-ip');
|
|
if (realIp) return realIp;
|
|
try {
|
|
const url = new URL(req.url);
|
|
return url.hostname || 'unknown';
|
|
} catch {
|
|
return 'unknown';
|
|
}
|
|
}
|