Add full SEO optimization for Spanglish social and language events
- Add comprehensive metadata to root layout with Open Graph, Twitter cards - Create dynamic sitemap.ts for all pages and events - Create robots.ts with proper allow/disallow rules - Add JSON-LD Event structured data to event detail pages - Add page-specific metadata to events, community, contact, FAQ pages - Add FAQ structured data schema - Update footer with local SEO text for Asunción, Paraguay - Add web manifest for mobile SEO - Create 404 page with proper noindex - Optimize image alt text and add lazy loading - Add NEXT_PUBLIC_SITE_URL env variable - Add about/ folder to gitignore
This commit is contained in:
@@ -26,13 +26,30 @@ const app = new Hono();
|
||||
// Middleware
|
||||
app.use('*', logger());
|
||||
|
||||
// CORS: Only enable in development. In production, nginx handles CORS.
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
app.use('*', cors({
|
||||
origin: process.env.FRONTEND_URL || 'http://localhost:3002',
|
||||
// CORS
|
||||
// - In production we *typically* rely on nginx to set CORS, but enabling it here
|
||||
// is a safe fallback (especially for local/proxyless deployments).
|
||||
// - `FRONTEND_URL` should be set to e.g. https://spanglishcommunity.com in prod.
|
||||
const frontendUrl = process.env.FRONTEND_URL || 'http://localhost:3002';
|
||||
const allowedOrigins = new Set<string>([
|
||||
frontendUrl,
|
||||
// Common alias (www) for the same site.
|
||||
frontendUrl.replace('://www.', '://'),
|
||||
frontendUrl.includes('://') ? frontendUrl.replace('://', '://www.') : frontendUrl,
|
||||
]);
|
||||
|
||||
app.use(
|
||||
'*',
|
||||
cors({
|
||||
origin: (origin) => {
|
||||
// Non-browser / same-origin requests may omit Origin.
|
||||
if (!origin) return frontendUrl;
|
||||
return allowedOrigins.has(origin) ? origin : null;
|
||||
},
|
||||
// We use bearer tokens, but keeping credentials=true matches nginx config.
|
||||
credentials: true,
|
||||
}));
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
// OpenAPI specification
|
||||
const openApiSpec = {
|
||||
|
||||
Reference in New Issue
Block a user