Pinedo11/nestDemo-ChatServer

bug: Property 'listen' does not exist on type 'Promise<INestApplication>'.

Opened this issue · 1 comments

In the index.ts file, the NestFactory object created cannot directly listen to the port via app.listen()

I revised it. src/index.ts

const app = NestFactory.create(ApplicationModule, instance);
// app.listen(3000, () => console.log('Applicacion is listening on port 3000'));

app.then(nestInstance =>
    nestInstance.listen(3000, () => {
      console.log('Applicacion is listening on port 3000');
    })
  ).catch(err => {
    console.error(
      'Application is listen on port 3000 failed to start',
      err
    );
  });