Uses AppModule.compile()
to build core providers without serving an adapter.
1. Install the package into your existing project:
npm i -E @bechara/crux
2. Add the following code at your bootstrap:
import { AppModule } from '@bechara/crux';
async function bootstrap() {
// ...
const app = await AppModule.compile();
// ...
}
3. Acquire the providers you would like to use by calling .get()
method of compile application:
// Compile app
const app = await AppModule.compile();
// Acquire providers
const appService = app.get(AppService);
const logService = app.get(LogService);
// Use providers
const appStatus = appService.getStatus();
logService.warn(appStatus);