Skip to content

Latest commit

 

History

History
46 lines (30 loc) · 796 Bytes

standalone.md

File metadata and controls

46 lines (30 loc) · 796 Bytes

Standalone Usage

Uses AppModule.compile() to build core providers without serving an adapter.


Installation

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);

Back to title