Created
February 19, 2019 14:18
-
-
Save ahmadarif/f5773b580df780738d2eaaf4523f53a1 to your computer and use it in GitHub Desktop.
Medium: Nest Tutorial S1 - Application Context
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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