In the main.ts file in Nest JS, the following bootstrap function contains the app.listen() method.
async function bootstrap() {
const app = await NestFactory.create(AppModule);
await app.listen(3000);
}
My question is what is the actual use of the following parameters:
- hostname: string,
- callback?: () => void
specially that the listenAsync is deprecated and the current .listen() method can be awaited, so why will I ever use the callback that is executed when the server is running.