Skip to content

Instantly share code, notes, and snippets.

@malikdoksoz
Created June 14, 2022 18:42
Show Gist options
  • Save malikdoksoz/44a730257ddb1b8e9bef08844123b30c to your computer and use it in GitHub Desktop.
Save malikdoksoz/44a730257ddb1b8e9bef08844123b30c to your computer and use it in GitHub Desktop.
adonisjs 5 websocket
import { ApplicationContract } from '@ioc:Adonis/Core/Application'
export default class AppProvider {
constructor(protected app: ApplicationContract) {}
public register() {
// Register your own bindings
}
public async boot() {
// IoC container is ready
}
public async ready() {
// App is ready
if (this.app.environment === 'web') {
await import('../start/socket')
}
}
public async shutdown() {
// Cleanup, since app is going down
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment