Repository navigation
feat(core): change listen to reject on server bind failures - #3360
Merged
kamilmysliwiec merged 1 commit intoJan 27, 2021
Merged
Conversation
Pull Request Test Coverage Report for Build f53a9d1a-cad8-4ba0-b94c-921bd5f9b973
💛 - Coveralls |
| if (address) { | ||
| this.httpServer.removeListener('error', errorHandler); | ||
| this.isListening = true; | ||
| this.logger.log(`Server listening at ${this.formatAddress(address)}`); |
Member
There was a problem hiding this comment.
We decided to don't log anything automatically leaving this decision to the developer
Contributor
Author
There was a problem hiding this comment.
Removed the automatic log here.
| }); | ||
| } | ||
|
|
||
| public listenAsync(port: number | string, hostname?: string): Promise<any> { |
Member
There was a problem hiding this comment.
This method can be depracated
Contributor
Author
There was a problem hiding this comment.
Removed listenAsync function.
| callback?: () => void, | ||
| ): Promise<any>; | ||
| public async listen(port: number | string): Promise<any>; | ||
| public async listen(port: number | string, hostname: string): Promise<any>; |
Member
There was a problem hiding this comment.
Remember to update INestApplication as well
This was referenced Jan 8, 2021
micalevisk
reviewed
Jan 12, 2021
| import { AppModule } from '../src/app.module'; | ||
| import { INestApplication } from '@nestjs/common'; | ||
|
|
||
| describe('Listen (Express Application', () => { |
Member
There was a problem hiding this comment.
Fastify here instead of Express, and add missing closing parentheses
micalevisk
reviewed
Jan 12, 2021
| import { AppModule } from '../src/app.module'; | ||
| import { INestApplication } from '@nestjs/common'; | ||
|
|
||
| describe('Listen (Express Application', () => { |
Member
There was a problem hiding this comment.
add missing closing parentheses
branbranmuffin
force-pushed
the
feature/listen-exception-handler
branch
2 times, most recently
from
January 13, 2021 00:06
ec75e10 to
b986129
Compare
branbranmuffin
force-pushed
the
feature/listen-exception-handler
branch
from
January 13, 2021 01:25
b986129 to
4cc2d18
Compare
2 of 3 tasks
This was referenced May 26, 2021
This was referenced Jul 7, 2021
This was referenced Jul 10, 2021
This was referenced Jul 19, 2021
This was referenced Jul 26, 2021
This was referenced Aug 3, 2021
This was referenced Sep 29, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Updates the app listen function to return a promise. Allows developer to see http bind errors and handle them when calling
app.listen(). Also logs url on successful server startup.What is the current behavior?
The app would exit silently if the server failed to bind.
Issue 3209
Issue Number: 3209
What is the new behavior?
Updates the app listen function to return a promise. Allows developer to see http bind errors and handle them when calling
app.listen(). Also logs url on successful server startup.Does this PR introduce a breaking change?
Other information