expand config

This commit is contained in:
jurgis
2022-12-11 13:17:10 +02:00
parent 80ba785798
commit 0b438fb134
10 changed files with 72 additions and 36 deletions
+33
View File
@@ -0,0 +1,33 @@
import { ConfigService } from './config.service';
import { join } from 'path';
export class PathsConfig {
constructor(private readonly configService: ConfigService) {
this.configService = configService;
}
public getStaticRequestsLogPath(): string {
return join(
this.getRootPath(),
this.configService.getEnv('LOG_FILE_REQUESTS'),
);
}
public getStaticFolder(): string {
return join(
this.getRootPath(),
this.configService.getEnv('STATIC_SERVE_FOLDER'),
);
}
public getRecentSearchesFolder(): string {
return join(
this.getRootPath(),
this.configService.getEnv('RECENT_SEARCHES_FOLDER'),
);
}
private getRootPath(): string {
return join(__dirname, '../..');
}
}