Skip to content

Instantly share code, notes, and snippets.

@ahmadarif
Created February 19, 2019 14:18
Show Gist options
  • Save ahmadarif/f5773b580df780738d2eaaf4523f53a1 to your computer and use it in GitHub Desktop.
Save ahmadarif/f5773b580df780738d2eaaf4523f53a1 to your computer and use it in GitHub Desktop.
Medium: Nest Tutorial S1 - Application Context
import { NestApplication, NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
let context: NestApplication = null;
export const ApplicationContext = async () => {
if (!context) {
context = await NestFactory.create(AppModule) as NestApplication;
}
return context;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment