2024-03-14 19:25:27 +00:00
|
|
|
import { ApplicationService } from "@adonisjs/core/types";
|
2024-01-26 08:39:03 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| Provider
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
| Your application is not ready when this file is loaded by the framework.
|
|
|
|
| Hence, the top level imports relying on the IoC container will not work.
|
|
|
|
| You must import them inside the life-cycle methods defined inside
|
|
|
|
| the provider class.
|
|
|
|
|
|
|
|
|
| @example:
|
|
|
|
|
|
|
|
|
| public async ready () {
|
|
|
|
| const Database = this.app.container.resolveBinding('Adonis/Lucid/Database')
|
|
|
|
| const Event = this.app.container.resolveBinding('Adonis/Core/Event')
|
|
|
|
| Event.on('db:query', Database.prettyPrint)
|
|
|
|
| }
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
export default class DoiProvider {
|
2024-03-14 19:25:27 +00:00
|
|
|
constructor(protected app: ApplicationService) {}
|
2024-01-26 08:39:03 +00:00
|
|
|
|
|
|
|
public register() {
|
|
|
|
// Register your own bindings
|
|
|
|
}
|
|
|
|
|
|
|
|
public async boot() {
|
|
|
|
// All bindings are ready, feel free to use them
|
|
|
|
}
|
|
|
|
|
|
|
|
public async ready() {
|
|
|
|
// App is ready
|
|
|
|
}
|
|
|
|
|
|
|
|
public async shutdown() {
|
|
|
|
// Cleanup, since app is going down
|
|
|
|
}
|
|
|
|
}
|