Skip to content

Commit

Permalink
docs: update Application page
Browse files Browse the repository at this point in the history
- consistency with links
- better example names
- spacing

- connected to #988
  • Loading branch information
virkt25 committed Mar 27, 2018
1 parent d2daf38 commit 07bf7bf
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions docs/site/Application.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ summary:
## What is an Application?

In LoopBack 4, the
[`Application`](http://apidocs.strongloop.com/@loopback%2fcore/#Application)
[`Application`](http://apidocs.loopback.io/@loopback%2fcore/#Application)
class is the central class for setting up all of your module's components,
controllers, servers and bindings. The `Application` class extends
[Context](Context.md), and provides the controls for starting and stopping
Expand All @@ -33,8 +33,8 @@ as a part of your setup:

```ts
import {Application} from '@loopback/core';
import {RestComponent, RestServer} from '@loopback/rest';
import {SamoflangeController, DoohickeyController} from './controllers';
import {RestComponent} from '@loopback/rest';
import {UserController, ShoppingCartController} from './controllers';

export class WidgetApplication extends Application {
constructor() {
Expand All @@ -50,8 +50,8 @@ export class WidgetApplication extends Application {
// You can bind to the Application-level context here.
// app.bind('foo').to(bar);
app.component(RestComponent);
app.controller(SamoflangeController);
app.controller(DoohickeyController);
app.controller(UserController);
app.controller(ShoppingCartController);
}

async stop() {
Expand Down Expand Up @@ -168,9 +168,9 @@ context under the keys `servers.public`, and `servers.private` respectively.
### Constructor configuration

The `Application` class constructor also accepts an
[`ApplicationConfig`](http://apidocs.strongloop.com/@loopback%2fcore/#ApplicationConfig)
[`ApplicationConfig`](http://apidocs.loopback.io/@loopback%2fcore/#ApplicationConfig)
object which contains component-level configurations such as
[`RestServerConfig`](http://apidocs.strongloop.com/@loopback%2frest/#RestServerConfig).
[`RestServerConfig`](http://apidocs.loopback.io/@loopback%2frest/#RestServerConfig).
It will automatically create bindings for these configurations and later be
injected through dependency injections. Visit
[Dependency Injection](Dependency-injection.md) for more details.
Expand Down Expand Up @@ -198,8 +198,8 @@ Here are some tips to help avoid common pitfalls and mistakes.

### Extend from `RestApplication` when using `RestServer`

If you want to use `RestServer` from our `@loopback/rest` package, we recommend
you extend `RestApplication` in your app instead of manually binding
If you want to use `RestServer` from `@loopback/rest` package, we recommend
extending `RestApplication` in your app instead of manually binding
`RestServer` or `RestComponent`. `RestApplication` already uses `RestComponent`
and makes useful functions in `RestServer` like `handler()` available at the app
level. This means you can call these `RestServer` functions to do all of your
Expand Down

0 comments on commit 07bf7bf

Please sign in to comment.