Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lb4): Application fixup #525

Merged
merged 2 commits into from
Nov 9, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions pages/en/lb4/Application.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,17 @@ export class WidgetApplication extends Application {
const server = await app.getServer(RestServer);
server.bind('rest.port').to(8080);
server.api(WidgetApi);
// The superclass start method will call start on all servers that are
// bound to the application.
return await super.start();
}

async stop() {
// This is where you would do whatever is necessary before stopping your
// app (graceful closing of connections, flushing buffers, etc)
console.log('Widget application is shutting down...')
// The superclass stop method will call stop on all servers that are
// bound to the application.
await super.stop();
}
}
Expand All @@ -84,14 +88,14 @@ bindings, like `component`, `server` and `controller`:
export class MyApplication extends Application {
constructor() {
super();
}
this.component(MagicSuite);
this.server(RestServer, 'public');
this.server(RestServer, 'private');
this.component(MagicSuite);
this.server(RestServer, 'public');
this.server(RestServer, 'private');

this.controller(FooController);
this.controller(BarController);
this.controller(BazController);
this.controller(FooController);
this.controller(BarController);
this.controller(BazController);
}
}
```

Expand Down