ditch nestjs config module, add static config serfice

This commit is contained in:
Jurgis Sakalauskas
2022-12-09 11:37:44 +02:00
parent b353e00bec
commit 7e5fa1fb2a
11 changed files with 86 additions and 102 deletions
+2 -1
View File
@@ -7,6 +7,7 @@ import { readdir, stat } from 'fs/promises';
import { Stats } from 'fs';
import { join } from 'path';
import FileDto from './Dto/file.dto';
import { configService } from '../config/config.service';
@Injectable()
export class StaticService {
@@ -17,7 +18,7 @@ export class StaticService {
);
}
const path = join(__dirname, process.env.STATIC_SERVE_FOLDER, relPath);
const path = join(configService.getStaticFolder(), relPath);
const stats: Stats | false = await stat(path).catch(() => false);