mirror of
https://github.com/ArthurDanjou/artdanj-shortener.git
synced 2026-01-14 18:59:56 +01:00
33 lines
821 B
TypeScript
33 lines
821 B
TypeScript
import { ApplicationContract } from '@ioc:Adonis/Core/Application'
|
|
|
|
export default class AppProvider {
|
|
public static needsApplication = true
|
|
|
|
constructor (protected app: ApplicationContract) {
|
|
}
|
|
|
|
public register () {
|
|
}
|
|
|
|
public async boot () {
|
|
}
|
|
|
|
public async ready () {
|
|
const { default: User } = await import('App/Models/User')
|
|
const { default: Env } = await import('@ioc:Adonis/Core/Env')
|
|
const { default: Logger } = await import('@ioc:Adonis/Core/Logger')
|
|
const user = await User.firstOrCreate({
|
|
email: Env.get('ADMIN_USER', 'admin@linkyjs.dev')
|
|
}, {
|
|
email: Env.get('ADMIN_USER', 'admin@linkyjs.dev'),
|
|
password: Env.get('ADMIN_PASSWORD', 'password')
|
|
})
|
|
if (user) {
|
|
Logger.info('User successfully created')
|
|
}
|
|
}
|
|
|
|
public async shutdown () {
|
|
}
|
|
}
|