Skip to content

Instantly share code, notes, and snippets.

@MrCube42

MrCube42/main.ts Secret

Created March 28, 2020 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MrCube42/3195cb2c9b714ea8f026c9687c045e8a to your computer and use it in GitHub Desktop.
Save MrCube42/3195cb2c9b714ea8f026c9687c045e8a to your computer and use it in GitHub Desktop.
Inhalt der main.ts zum Start des Nest Backends. Die Konfiguration der Plattform, das Vornehmen zusätzlicher Einstellungen wie CORS, das Zuweisen des Ports oder das Hinzufügen von optionalen Plugins findet hier statt.
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule); // Hier könnte man die Plattform von Express auf Fastify wechseln
app.enableCors();
await app.listen(3000);
}
bootstrap();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment