diff --git a/docs/site/Booting-an-Application.md b/docs/site/Booting-an-Application.md index 6996ad628c32..1b19adcf4649 100644 --- a/docs/site/Booting-an-Application.md +++ b/docs/site/Booting-an-Application.md @@ -46,10 +46,12 @@ package (with custom booters). ## BootMixin Boot functionality can be added to a LoopBack 4 Application by mixing it with -the `BootMixin`. The Mixin adds the `BootComponent` to your Application as well -as convenience methods such as `app.boot()` and `app.booters()`. The Mixin also -allows Components to set the property `booters` as an Array of `Booters`. They -will be bound to the Application and called by the `Bootstrapper`. +the `BootMixin` +[mixin](https://www.typescriptlang.org/docs/handbook/mixins.html). This mixin +adds the `BootComponent` to your Application as well as convenience methods such +as `app.boot()` and `app.booters()`. The Mixin also allows Components to set the +property `booters` as an Array of `Booters`. They will be bound to the +Application and called by the `Bootstrapper`. Since this is a convention-based Bootstrapper, it is important to set a `projectRoot`, as all other artifact paths will be resolved relative to this diff --git a/docs/site/Creating-components.md b/docs/site/Creating-components.md index ea9b8ed2e398..f604386278fc 100644 --- a/docs/site/Creating-components.md +++ b/docs/site/Creating-components.md @@ -31,6 +31,23 @@ export class MyComponent implements Component { } ``` +You can inject anything to from the context and access them from a component. In +the following example the REST server instance is made available in the +component via dependency injection. + +```ts +import {Component, CoreBindings} from '@loopback/core'; +import {RestApplication} from '@loopback/rest'; +export class MyComponent implements Component { + constructor( + @inject(CoreBindings.APPLICATION_INSTANCE) + private application: RestApplication, + ) { + // The rest server instance can be accessed from this component + } +} +``` + When a component is mounted to an application, a new instance of the component class is created and then: diff --git a/docs/site/Server.md b/docs/site/Server.md index 58c264a5119b..a646e3fa8738 100644 --- a/docs/site/Server.md +++ b/docs/site/Server.md @@ -145,7 +145,7 @@ Hosting the API Explorer at an external URL has a few downsides, for example a working internet connection is required to explore the API. As a recommended alternative, LoopBack comes with an extension that provides a self-hosted Explorer UI. Please refer to -[Self-hosted REST API Explorer](./Self-hosted-rest-api-explorer.md) for more +[Self-hosted REST API Explorer](Self-hosted-rest-api-explorer.md) for more details. ### Enable HTTPS