17 lines
461 B
TypeScript
17 lines
461 B
TypeScript
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 { }
|