mirror of
https://github.com/sakaljurgis/kodi-api-server.git
synced 2026-07-08 20:37:41 +00:00
add start script
This commit is contained in:
@@ -8,7 +8,9 @@ export class RequestLogMiddleware implements NestMiddleware {
|
||||
async use(req: Request, res: Response, next: NextFunction) {
|
||||
const strIP = this.extractIp(req);
|
||||
this.log(strIP + ' ' + req.method + ' ' + decodeURI(req.url));
|
||||
console.log(decodeURI(req.url));
|
||||
if (configService.isDev()) {
|
||||
console.log(decodeURI(req.url));
|
||||
}
|
||||
|
||||
next();
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
import { StaticService } from './static.service';
|
||||
|
||||
describe('StaticService', () => {
|
||||
let staticService: StaticService;
|
||||
|
||||
beforeEach(() => {
|
||||
staticService = new StaticService();
|
||||
});
|
||||
|
||||
describe('provideDirIndex', () => {
|
||||
it('should return file/dir list of dir', async () => {
|
||||
jest.spyOn(staticService, 'provideDirIndex');
|
||||
process.env.STATIC_SERVE_FOLDER = 'test/Static/_test-data/StaticServe';
|
||||
|
||||
const result = await staticService.provideDirIndex('');
|
||||
expect(result).toHaveLength(2);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -38,6 +38,10 @@ export class ConfigService {
|
||||
public getRecentSearchesConfig(): RecentSearchesConfig {
|
||||
return this.recentSearches;
|
||||
}
|
||||
|
||||
public isDev(): boolean {
|
||||
return this.getEnv('NODE_ENV') !== 'production';
|
||||
}
|
||||
}
|
||||
|
||||
export const configService = new ConfigService();
|
||||
|
||||
Reference in New Issue
Block a user