question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Binding IP for a nest application is verbose

See original GitHub issue

Hullo 👋

Currently if you want to bind your express instance to a specific IP you end up with something like this:

@Module({})
class ApplicationModule {}x

function createApp (
  server: express.Application,
  port: number,
  address: string
): Promise<INestApplication> {
  const app = NestFactory.create(ApplicationModule, server)
  app.init()

  return eventToPromise(server.listen(port, address), 'listening').then(
    () => app
  )
}

It would seem more ideal if NestApplication.listen() better reflected the options that ExpressAppliation.listen() takes? The above isn’t so ideal given that it doesn’t check if the nest application has already been initialised.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
xeoneuxcommented, Sep 13, 2017

@TobyColeman environment variables?

1reaction
kamilmysliwieccommented, Oct 1, 2017

Hi @TobyColeman, Since @nestjs/core 4.0.4 the listen() method accepts hostname as a second argument 🙂

Read more comments on GitHub >

github_iconTop Results From Across the Web

DHCP IP reservation or Set a Static IP address for a device
Open the Google Home app . Tap Wi-Fi and then Settings and then Advanced Networking. Tap DHCP IP reservations and then Add IP...
Read more >
gRPC - Microservices - A progressive Node.js framework
Nest is a framework for building efficient, scalable Node.js server-side applications. It uses progressive JavaScript, is built with TypeScript and combines ...
Read more >
Node.js EACCES error when listening on most ports
I use npm run dev to run my Nodejs app in Windows and it works fine. But I got this error on my...
Read more >
Oppo Blu-ray player - Bindings - openHAB
# Thing Configuration · If using direct IP connection on the BDP series (83/93/95/103/105), verbose mode is not supported. · For some reason...
Read more >
Nodejs Security - OWASP Cheat Sheet Series
Node.js applications are prone to all kinds of web application vulnerabilities. ... can be used to feed Intrusion Detection/Prevention Systems (IDS/IPS).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found