You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

16 line
569 B

  1. // Hook eseguito una sola volta all'avvio del server Next.
  2. // L'unico compito attuale è il bootstrap del factory preset quando data/ è vuoto.
  3. export async function register() {
  4. // Esegui solo nel runtime Node (l'instrumentation può girare anche su Edge,
  5. // dove fs/spawn non esistono).
  6. if (process.env.NEXT_RUNTIME !== 'nodejs') return;
  7. const { bootstrapFromFactoryPresetIfEmpty } = await import('@/lib/bootstrap');
  8. try {
  9. await bootstrapFromFactoryPresetIfEmpty();
  10. } catch (err) {
  11. console.warn('[instrumentation] Bootstrap error:', err);
  12. }
  13. }