import { Module } from '@nestjs/common';
import { ServeStaticModule } from '@nestjs/serve-static';
import { join } from 'path';

// Resolve the storage directory (default to ../storage relative to the compiled or source path)
const storageDir = process.env.STORAGE_DIR || join(__dirname, '..', '..', 'storage');

@Module({
  imports: [
    ServeStaticModule.forRoot({
      rootPath: storageDir,
      serveRoot: '/',
    }),
  ],
})
export class AppModule { }
