www/src/app/AppUnit.ts

20 lines
528 B
TypeScript
Raw Normal View History

2022-04-05 19:24:36 +00:00
import {Config, Inject, ORMUser, Singleton, Unit} from '@extollo/lib'
2022-03-29 12:55:55 +00:00
import {User} from './models/User.model'
2022-04-05 19:24:36 +00:00
import {Gotify} from 'gotify'
2022-03-29 12:55:55 +00:00
@Singleton()
export class AppUnit extends Unit {
2022-04-05 19:24:36 +00:00
@Inject()
protected readonly config!: Config
2022-03-29 12:55:55 +00:00
async up(): Promise<void> {
this.container().registerStaticOverride(ORMUser, User)
2022-04-05 19:24:36 +00:00
const gotify = new Gotify({
server: this.config.safe('gotify.server').string(),
})
this.container().registerSingletonInstance(Gotify, gotify)
2022-03-29 12:55:55 +00:00
}
}