import ApplicationComponent from "../ApplicationComponent"; import {Express, Router} from "express"; import MysqlConnectionManager from "../db/MysqlConnectionManager"; export default class MysqlComponent extends ApplicationComponent { public async start(app: Express, router: Router): Promise { await this.prepare('Mysql connection', () => MysqlConnectionManager.prepare()); } public async stop(): Promise { await MysqlConnectionManager.endPool(); } public canServe(): boolean { return MysqlConnectionManager.pool !== undefined; } }