Add cache interface, factory, and basic in-mem implementation

This commit is contained in:
2021-03-09 10:16:27 -06:00
parent 42d9cc101f
commit 088fdfb1ef
5 changed files with 138 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ import {Logging} from '../service/Logging';
import {RunLevelErrorHandler} from "./RunLevelErrorHandler";
import {Unit, UnitStatus} from "./Unit";
import * as dotenv from 'dotenv';
import {CacheFactory} from "../support/cache/CacheFactory";
export function env(key: string, defaultValue?: any): any {
return Application.getApplication().env(key, defaultValue)
@@ -103,6 +104,8 @@ export class Application extends Container {
this.bootstrapEnvironment()
this.setupLogging()
this.registerFactory(new CacheFactory()) // FIXME move this somewhere else?
this.make<Logging>(Logging).debug(`Application root: ${this.baseDir}`)
}