@suitespot/inversify-application
v0.3.0
Published
Inversify module framework
Downloads
122
Maintainers
Keywords
Readme
Inversify Application Module Framework
Usage:
// Declare all functionality in Application Modules
class FancyModule extends ApplicationModule {
public bind(container: Container): void {
// bind some resources to the container
}
public start(container: Container): Promise<any> {
// start any services that require external resources (e.g. database)
}
}
// bootstrap the application
let application = new InversifyApplication([
new FancyModule()
// ... other modules
], LogFactory.getLogger('MyApp'));
application.start()
.then(() => {
console.log('Application Started');
})
.catch(err => {
console.log('Application startup failed');
process.exit(1);
});