- Add auto-deploy.sh script with full CI/CD pipeline - Add quick-deploy.sh for fast development deployments - Add Git post-receive hook for automatic deployment on push - Add comprehensive deployment documentation - Add npm scripts for easy deployment management - Include health checks, logging, and cleanup - Support for automatic rollback on failures
32 lines
878 B
TypeScript
32 lines
878 B
TypeScript
import { NextRequest, NextResponse } from 'next/server';
|
|
|
|
export async function POST(request: NextRequest) {
|
|
try {
|
|
const body = await request.json();
|
|
|
|
// Log performance metrics (you can extend this to store in database)
|
|
console.log('Performance Metric:', {
|
|
timestamp: new Date().toISOString(),
|
|
...body,
|
|
});
|
|
|
|
// You could store this in a database or send to external service
|
|
// For now, we'll just log it since Umami handles the main analytics
|
|
|
|
return NextResponse.json({ success: true });
|
|
} catch (error) {
|
|
console.error('Analytics API Error:', error);
|
|
return NextResponse.json(
|
|
{ error: 'Failed to process analytics data' },
|
|
{ status: 500 }
|
|
);
|
|
}
|
|
}
|
|
|
|
export async function GET() {
|
|
return NextResponse.json({
|
|
message: 'Analytics API is running',
|
|
timestamp: new Date().toISOString(),
|
|
});
|
|
}
|