Files
chadebebe/instrumentation.ts
michaeltieso 3480888eaa Initial commit
2025-12-01 14:49:17 +00:00

14 lines
474 B
TypeScript

/**
* Next.js Instrumentation Hook
* This runs once when the Next.js server starts up
* Perfect for initializing the database and seeding it with sample data
*/
export async function register() {
// Only run in production/development runtime, not during build
if (process.env.NEXT_RUNTIME === 'nodejs' && process.env.NEXT_PHASE !== 'phase-production-build') {
const { initializeDatabase } = await import('./lib/db/index');
await initializeDatabase();
}
}