Created
March 27, 2025 18:42
-
-
Save Vatsalya-singhi/89d0b4d095110d1923e80cf8810fc720 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// main.ts | |
import { NestFactory } from '@nestjs/core'; | |
import { AppModule } from './app.module'; | |
import { AuthGuard } from './auth.guard'; | |
async function bootstrap() { | |
const app = await NestFactory.create(AppModule); | |
app.useGlobalGuards(new AuthGuard()); // Apply globally | |
await app.listen(3000); | |
} | |
bootstrap(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment