20 lines
572 B
TypeScript
20 lines
572 B
TypeScript
import {Express} from "express";
|
|
|
|
import ApplicationComponent from "../ApplicationComponent.js";
|
|
import MysqlConnectionManager from "../db/MysqlConnectionManager.js";
|
|
|
|
export default class MysqlComponent extends ApplicationComponent {
|
|
public async start(_app: Express): Promise<void> {
|
|
await this.prepare('Mysql connection', () => MysqlConnectionManager.prepare());
|
|
}
|
|
|
|
public async stop(): Promise<void> {
|
|
await MysqlConnectionManager.endPool();
|
|
}
|
|
|
|
public canServe(): boolean {
|
|
return MysqlConnectionManager.isReady();
|
|
}
|
|
|
|
}
|