Skip to content

feat: add listening property in the server interface#1479

Merged
raymondfeng merged 1 commit into
loopbackio:masterfrom
fernandobastos:feature/listening-prop
Jun 27, 2018
Merged

feat: add listening property in the server interface#1479
raymondfeng merged 1 commit into
loopbackio:masterfrom
fernandobastos:feature/listening-prop

Conversation

@fernandobastos
Copy link
Copy Markdown

@fernandobastos fernandobastos commented Jun 26, 2018

  • Add listening property to Server
  • Update start and stop methods in RestServer/RPCServer to use the new property

fix #1368

Checklist

  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • API Documentation in code was updated
  • Documentation in /docs/site was updated
  • Affected artifact templates in packages/cli were updated
  • Affected example projects in examples/* were updated

@raymondfeng
Copy link
Copy Markdown
Contributor

@fernandobastos Thanks for the patch.

To be consistent, please also update https://github.com/strongloop/loopback-next/blob/master/packages/http-server/src/http-server.ts to use listening instead of _started.

@raymondfeng
Copy link
Copy Markdown
Contributor

Comment thread packages/http-server/src/http-server.ts Outdated
private _port: number;
private _host?: string;
private _started: Boolean;
private listening: Boolean;
Copy link
Copy Markdown
Contributor

@raymondfeng raymondfeng Jun 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be private _listening: boolean and add a get function to expose the value so that it's readonly.

private _listening: boolean = false;
get listening() {
  return this._listening;
}

You should replace get started() with get listening().

Copy link
Copy Markdown
Contributor

@raymondfeng raymondfeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the listening in http-server module. There is also a build error:

packages/http-server/src/http-server.ts(121,17): error TS2551: Property '_started' does not exist on type 'HttpServer'. Did you mean 'started'?

@raymondfeng
Copy link
Copy Markdown
Contributor

@fernandobastos Please fix the build error:

packages/http-server/src/http-server.ts(121,17): error TS2339: Property '_started' does not exist on type 'HttpServer'.

Copy link
Copy Markdown
Contributor

@raymondfeng raymondfeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please squash the commit into one.

- Add listening property to Server
- Update start and stop methods in RestServer/RpcServer
- Update http-server to use listening instead of _started
- Update server overview to mention the new property

fix #1368
@raymondfeng raymondfeng merged commit ff0eab7 into loopbackio:master Jun 27, 2018
@fernandobastos fernandobastos deleted the feature/listening-prop branch June 28, 2018 00:07
@bajtos
Copy link
Copy Markdown
Member

bajtos commented Jun 28, 2018

@fernandobastos thank you for the contribution ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

listening property in the Server interface

3 participants