UNPKG

@loopback/docs

Version:
1,929 lines (1,332 loc) 67.3 kB
<!DOCTYPE html> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title></title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="css/bootstrap.min.css"> <link rel="stylesheet" href="css/code-themes/sl-theme.css"> <link rel="stylesheet" href="css/main.css"> </head> <body> <div class="navbar navbar-inverse navbar-static-top" role="navigation"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="/">docs.strongloop.com</a> </div> <div id="modules"></div> </div> <div class="row"> <div class="col-lg-3 column scroll-spy-target"> <ul class="nav nav-pills nav-stacked"> <div id="versions"></div> <li class="depth-3"> <a href="#BootComponent">Class: BootComponent</a> </li> <li class="depth-4"> <a href="#69">constructor</a> </li> <li class="depth-3"> <a href="#BaseArtifactBooter">Class: BaseArtifactBooter</a> </li> <li class="depth-4"> <a href="#60">configure</a> </li> <li class="depth-4"> <a href="#62">discover</a> </li> <li class="depth-4"> <a href="#64">load</a> </li> <li class="depth-3"> <a href="#3">Function: discoverFiles</a> </li> <li class="depth-3"> <a href="#7">Function: isClass</a> </li> <li class="depth-3"> <a href="#10">Function: loadClassesFromFiles</a> </li> <li class="depth-3"> <a href="#ControllerBooter">Class: ControllerBooter</a> </li> <li class="depth-4"> <a href="#107">constructor</a> </li> <li class="depth-4"> <a href="#115">load</a> </li> <li class="depth-3"> <a href="#ControllerDefaults">Object literal: ControllerDefaults</a> </li> <li class="depth-3"> <a href="#RepositoryBooter">Class: RepositoryBooter</a> </li> <li class="depth-4"> <a href="#133">constructor</a> </li> <li class="depth-4"> <a href="#141">load</a> </li> <li class="depth-3"> <a href="#RepositoryDefaults">Object literal: RepositoryDefaults</a> </li> <li class="depth-3"> <a href="#Bootstrapper">Class: Bootstrapper</a> </li> <li class="depth-4"> <a href="#83">constructor</a> </li> <li class="depth-4"> <a href="#88">boot</a> </li> <li class="depth-3"> <a href="#Bootable">Interface: Bootable</a> </li> <li class="depth-4"> <a href="#24">boot</a> </li> <li class="depth-4"> <a href="#26">booters</a> </li> <li class="depth-3"> <a href="#Booter">Interface: Booter</a> </li> <li class="depth-4"> <a href="#15">configure</a> </li> <li class="depth-4"> <a href="#17">discover</a> </li> <li class="depth-4"> <a href="#19">load</a> </li> <li class="depth-3"> <a href="#ArtifactOptions">Type alias: ArtifactOptions</a> </li> <li class="depth-3"> <a href="#BootExecutionOptions">Type alias: BootExecutionOptions</a> </li> <li class="depth-3"> <a href="#BootOptions">Type alias: BootOptions</a> </li> <li class="depth-3"> <a href="#73">Function: BootMixin</a> </li> <li class="depth-3"> <a href="#77">Function: _bindBooter</a> </li> </ul> </div> <div class="col-lg-9 col-lg-offset-3 column" data-spy="scroll" data-target=".scroll-spy-target" data-offset="0"> <div class="readability"> <section class="code-doc "> <a name="BootComponent"></a> <h3 class="code-ref">Class: bootcomponent = new BootComponent()</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>BootComponent is used to export the default list of Booter&#39;s made available by this module as well as bind the BootStrapper to the app so it can be used to run the Booters.</p> </p> <p></p> </div> </section> <section class="code-doc"> <div class="code-arguments-hdr">Properties</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name">booters</strong> </td> <td class="code-arg-types"> <code></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>BootComponent is used to export the default list of Booter&#39;s made available by this module as well as bind the BootStrapper to the app so it can be used to run the Booters.</p> </p> <p></p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="69"></a> <h4 class="code-ref">constructor(app: <a href="#Application">Application</a>) : BootComponent</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p></p> </div> <div class="code-arguments-hdr">Arguments</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">app</strong> </td> <td class="code-arg-types"> <code><a href="#Application">Application</a></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Application instance</p> </p> <p></p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="BaseArtifactBooter"></a> <h3 class="code-ref">Class: baseartifactbooter = new BaseArtifactBooter()</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>This class serves as a base class for Booters which follow a pattern of configure, discover files in a folder(s) using explicit folder / extensions or a glob pattern and lastly identifying exported classes from such files and performing an action on such files such as binding them.</p> </p> <p><p>Any Booter extending this base class is expected to</p> <ol> <li>Set the &#39;options&#39; property to a object of ArtifactOptions type. (Each extending class should provide defaults for the ArtifactOptions and use Object.assign to merge the properties with user provided Options).</li> <li>Provide it&#39;s own logic for &#39;load&#39; after calling &#39;await super.load()&#39; to actually boot the Artifact classes.</li> </ol> <p>Currently supports the following boot phases: configure, discover, load</p> </p> </div> </section> <section class="code-doc"> <div class="code-arguments-hdr">Properties</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name">classes</strong> </td> <td class="code-arg-types"> <code><a href="#Array">Array</a></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>This class serves as a base class for Booters which follow a pattern of configure, discover files in a folder(s) using explicit folder / extensions or a glob pattern and lastly identifying exported classes from such files and performing an action on such files such as binding them.</p> </p> <p><p>Any Booter extending this base class is expected to</p> <ol> <li>Set the &#39;options&#39; property to a object of ArtifactOptions type. (Each extending class should provide defaults for the ArtifactOptions and use Object.assign to merge the properties with user provided Options).</li> <li>Provide it&#39;s own logic for &#39;load&#39; after calling &#39;await super.load()&#39; to actually boot the Artifact classes.</li> </ol> <p>Currently supports the following boot phases: configure, discover, load</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name">dirs</strong> </td> <td class="code-arg-types"> <code></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>This class serves as a base class for Booters which follow a pattern of configure, discover files in a folder(s) using explicit folder / extensions or a glob pattern and lastly identifying exported classes from such files and performing an action on such files such as binding them.</p> </p> <p><p>Any Booter extending this base class is expected to</p> <ol> <li>Set the &#39;options&#39; property to a object of ArtifactOptions type. (Each extending class should provide defaults for the ArtifactOptions and use Object.assign to merge the properties with user provided Options).</li> <li>Provide it&#39;s own logic for &#39;load&#39; after calling &#39;await super.load()&#39; to actually boot the Artifact classes.</li> </ol> <p>Currently supports the following boot phases: configure, discover, load</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name">discovered</strong> </td> <td class="code-arg-types"> <code></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>This class serves as a base class for Booters which follow a pattern of configure, discover files in a folder(s) using explicit folder / extensions or a glob pattern and lastly identifying exported classes from such files and performing an action on such files such as binding them.</p> </p> <p><p>Any Booter extending this base class is expected to</p> <ol> <li>Set the &#39;options&#39; property to a object of ArtifactOptions type. (Each extending class should provide defaults for the ArtifactOptions and use Object.assign to merge the properties with user provided Options).</li> <li>Provide it&#39;s own logic for &#39;load&#39; after calling &#39;await super.load()&#39; to actually boot the Artifact classes.</li> </ol> <p>Currently supports the following boot phases: configure, discover, load</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name">extensions</strong> </td> <td class="code-arg-types"> <code></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>This class serves as a base class for Booters which follow a pattern of configure, discover files in a folder(s) using explicit folder / extensions or a glob pattern and lastly identifying exported classes from such files and performing an action on such files such as binding them.</p> </p> <p><p>Any Booter extending this base class is expected to</p> <ol> <li>Set the &#39;options&#39; property to a object of ArtifactOptions type. (Each extending class should provide defaults for the ArtifactOptions and use Object.assign to merge the properties with user provided Options).</li> <li>Provide it&#39;s own logic for &#39;load&#39; after calling &#39;await super.load()&#39; to actually boot the Artifact classes.</li> </ol> <p>Currently supports the following boot phases: configure, discover, load</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name">glob</strong> </td> <td class="code-arg-types"> <code>string</code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>This class serves as a base class for Booters which follow a pattern of configure, discover files in a folder(s) using explicit folder / extensions or a glob pattern and lastly identifying exported classes from such files and performing an action on such files such as binding them.</p> </p> <p><p>Any Booter extending this base class is expected to</p> <ol> <li>Set the &#39;options&#39; property to a object of ArtifactOptions type. (Each extending class should provide defaults for the ArtifactOptions and use Object.assign to merge the properties with user provided Options).</li> <li>Provide it&#39;s own logic for &#39;load&#39; after calling &#39;await super.load()&#39; to actually boot the Artifact classes.</li> </ol> <p>Currently supports the following boot phases: configure, discover, load</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name">options</strong> </td> <td class="code-arg-types"> <code><a href="#ArtifactOptions">ArtifactOptions</a></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Options being used by the Booter.</p> </p> <p></p> </div> </td> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name">projectRoot</strong> </td> <td class="code-arg-types"> <code>string</code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>This class serves as a base class for Booters which follow a pattern of configure, discover files in a folder(s) using explicit folder / extensions or a glob pattern and lastly identifying exported classes from such files and performing an action on such files such as binding them.</p> </p> <p><p>Any Booter extending this base class is expected to</p> <ol> <li>Set the &#39;options&#39; property to a object of ArtifactOptions type. (Each extending class should provide defaults for the ArtifactOptions and use Object.assign to merge the properties with user provided Options).</li> <li>Provide it&#39;s own logic for &#39;load&#39; after calling &#39;await super.load()&#39; to actually boot the Artifact classes.</li> </ol> <p>Currently supports the following boot phases: configure, discover, load</p> </p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="60"></a> <h4 class="code-ref">configure() : Promise</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Configure the Booter by initializing the &#39;dirs&#39;, &#39;extensions&#39; and &#39;glob&#39; properties.</p> </p> <p><p>NOTE: All properties are configured even if all aren&#39;t used.</p> </p> </div> </section> <section class="code-doc "> <a name="62"></a> <h4 class="code-ref">discover() : Promise</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Discover files based on the &#39;glob&#39; property relative to the &#39;projectRoot&#39;. Discovered artifact files matching the pattern are saved to the &#39;discovered&#39; property.</p> </p> <p></p> </div> </section> <section class="code-doc "> <a name="64"></a> <h4 class="code-ref">load() : Promise</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Filters the exports of &#39;discovered&#39; files to only be Classes (in case function / types are exported) as an artifact is a Class. The filtered artifact Classes are saved in the &#39;classes&#39; property.</p> </p> <p><p>NOTE: Booters extending this class should call this method (await super.load()) and then process the artifact classes as appropriate.</p> </p> </div> </section> <section class="code-doc "> <a name="3"></a> <h3 class="code-ref">Function: discoverFiles</h3> <section class="code-doc "> <a name="3"></a> <h4 class="code-ref">discoverFiles(pattern: string, root: string) : Promise</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Returns all files matching the given glob pattern relative to root</p> </p> <p></p> </div> Returns: <p><p>Array of discovered files</p> </p> <div class="code-arguments-hdr">Arguments</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">pattern</strong> </td> <td class="code-arg-types"> <code>string</code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>A glob pattern</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">root</strong> </td> <td class="code-arg-types"> <code>string</code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>Root folder to start searching for matching files</p> </p> </div> </td> </tr> </table> </section> </section> <section class="code-doc "> <a name="7"></a> <h3 class="code-ref">Function: isClass</h3> <section class="code-doc "> <a name="7"></a> <h4 class="code-ref">isClass(target: any) : boolean</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Given a function, returns true if it is a class, false otherwise.</p> </p> <p></p> </div> Returns: <p><p>True if target is a class. False otherwise.</p> </p> <div class="code-arguments-hdr">Arguments</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">target</strong> </td> <td class="code-arg-types"> <code>any</code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>The function to check if it&#39;s a class or not.</p> </p> </div> </td> </tr> </table> </section> </section> <section class="code-doc "> <a name="10"></a> <h3 class="code-ref">Function: loadClassesFromFiles</h3> <section class="code-doc "> <a name="10"></a> <h4 class="code-ref">loadClassesFromFiles(files: undefined) : </h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Returns an Array of Classes from given files. Works by requiring the file, identifying the exports from the file by getting the keys of the file and then testing each exported member to see if it&#39;s a class or not.</p> </p> <p></p> </div> Returns: <p><blockquote> <p>[]} An array of Class constructors from a file</p> </blockquote> </p> <div class="code-arguments-hdr">Arguments</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">files</strong> </td> <td class="code-arg-types"> <code></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p></p> <p><p>An array of string of absolute file paths</p> </p> </div> </td> </tr> </table> </section> </section> <section class="code-doc "> <a name="ControllerBooter"></a> <h3 class="code-ref">Class: controllerbooter = new ControllerBooter()</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>A class that extends BaseArtifactBooter to boot the &#39;Controller&#39; artifact type. Discovered controllers are bound using <code>app.controller()</code>.</p> </p> <p><p>Supported phases: configure, discover, load</p> </p> </div> </section> <section class="code-doc"> <div class="code-arguments-hdr">Properties</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name">app</strong> </td> <td class="code-arg-types"> <code><a href="#Application">Application</a></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>A class that extends BaseArtifactBooter to boot the &#39;Controller&#39; artifact type. Discovered controllers are bound using <code>app.controller()</code>.</p> </p> <p><p>Supported phases: configure, discover, load</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name">controllerConfig</strong> </td> <td class="code-arg-types"> <code><a href="#ArtifactOptions">ArtifactOptions</a></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>A class that extends BaseArtifactBooter to boot the &#39;Controller&#39; artifact type. Discovered controllers are bound using <code>app.controller()</code>.</p> </p> <p><p>Supported phases: configure, discover, load</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name">projectRoot</strong> </td> <td class="code-arg-types"> <code>string</code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>A class that extends BaseArtifactBooter to boot the &#39;Controller&#39; artifact type. Discovered controllers are bound using <code>app.controller()</code>.</p> </p> <p><p>Supported phases: configure, discover, load</p> </p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="107"></a> <h4 class="code-ref">constructor(app: <a href="#Application">Application</a>, projectRoot: string, controllerConfig: <a href="#ArtifactOptions">ArtifactOptions</a>) : ControllerBooter</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-arguments-hdr">Arguments</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">app</strong> </td> <td class="code-arg-types"> <code><a href="#Application">Application</a></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>A class that extends BaseArtifactBooter to boot the &#39;Controller&#39; artifact type. Discovered controllers are bound using <code>app.controller()</code>.</p> </p> <p><p>Supported phases: configure, discover, load</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">projectRoot</strong> </td> <td class="code-arg-types"> <code>string</code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>A class that extends BaseArtifactBooter to boot the &#39;Controller&#39; artifact type. Discovered controllers are bound using <code>app.controller()</code>.</p> </p> <p><p>Supported phases: configure, discover, load</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">controllerConfig</strong> </td> <td class="code-arg-types"> <code><a href="#ArtifactOptions">ArtifactOptions</a></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>A class that extends BaseArtifactBooter to boot the &#39;Controller&#39; artifact type. Discovered controllers are bound using <code>app.controller()</code>.</p> </p> <p><p>Supported phases: configure, discover, load</p> </p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="115"></a> <h4 class="code-ref">load() : Promise</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Uses super method to get a list of Artifact classes. Boot each class by binding it to the application using <code>app.controller(controller);</code>.</p> </p> <p></p> </div> </section> <section class="code-doc "> <a name="ControllerDefaults"></a> <h3 class="code-ref">Object literal: ControllerDefaults</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Default ArtifactOptions for ControllerBooter.</p> </p> <p></p> </div> </section> <section class="code-doc"> <div class="code-arguments-hdr">Variables</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name">dirs</strong> </td> <td class="code-arg-types"> <code></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Default ArtifactOptions for ControllerBooter.</p> </p> <p></p> </div> </td> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name">extensions</strong> </td> <td class="code-arg-types"> <code></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Default ArtifactOptions for ControllerBooter.</p> </p> <p></p> </div> </td> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name">nested</strong> </td> <td class="code-arg-types"> <code>true</code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Default ArtifactOptions for ControllerBooter.</p> </p> <p></p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="RepositoryBooter"></a> <h3 class="code-ref">Class: repositorybooter = new RepositoryBooter()</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>A class that extends BaseArtifactBooter to boot the &#39;Repository&#39; artifact type. Discovered repositories are bound using <code>app.repository()</code> which must be added to an Application using the <code>RepositoryMixin</code> from <code>@loopback/repository</code>.</p> </p> <p><p>Supported phases: configure, discover, load</p> </p> </div> </section> <section class="code-doc"> <div class="code-arguments-hdr">Properties</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name">app</strong> </td> <td class="code-arg-types"> <code><a href="#AppWithRepository">AppWithRepository</a></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>A class that extends BaseArtifactBooter to boot the &#39;Repository&#39; artifact type. Discovered repositories are bound using <code>app.repository()</code> which must be added to an Application using the <code>RepositoryMixin</code> from <code>@loopback/repository</code>.</p> </p> <p><p>Supported phases: configure, discover, load</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name">projectRoot</strong> </td> <td class="code-arg-types"> <code>string</code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>A class that extends BaseArtifactBooter to boot the &#39;Repository&#39; artifact type. Discovered repositories are bound using <code>app.repository()</code> which must be added to an Application using the <code>RepositoryMixin</code> from <code>@loopback/repository</code>.</p> </p> <p><p>Supported phases: configure, discover, load</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name">repositoryOptions</strong> </td> <td class="code-arg-types"> <code><a href="#ArtifactOptions">ArtifactOptions</a></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>A class that extends BaseArtifactBooter to boot the &#39;Repository&#39; artifact type. Discovered repositories are bound using <code>app.repository()</code> which must be added to an Application using the <code>RepositoryMixin</code> from <code>@loopback/repository</code>.</p> </p> <p><p>Supported phases: configure, discover, load</p> </p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="133"></a> <h4 class="code-ref">constructor(app: <a href="#AppWithRepository">AppWithRepository</a>, projectRoot: string, repositoryOptions: <a href="#ArtifactOptions">ArtifactOptions</a>) : RepositoryBooter</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-arguments-hdr">Arguments</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">app</strong> </td> <td class="code-arg-types"> <code><a href="#AppWithRepository">AppWithRepository</a></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>A class that extends BaseArtifactBooter to boot the &#39;Repository&#39; artifact type. Discovered repositories are bound using <code>app.repository()</code> which must be added to an Application using the <code>RepositoryMixin</code> from <code>@loopback/repository</code>.</p> </p> <p><p>Supported phases: configure, discover, load</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">projectRoot</strong> </td> <td class="code-arg-types"> <code>string</code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>A class that extends BaseArtifactBooter to boot the &#39;Repository&#39; artifact type. Discovered repositories are bound using <code>app.repository()</code> which must be added to an Application using the <code>RepositoryMixin</code> from <code>@loopback/repository</code>.</p> </p> <p><p>Supported phases: configure, discover, load</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">repositoryOptions</strong> </td> <td class="code-arg-types"> <code><a href="#ArtifactOptions">ArtifactOptions</a></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>A class that extends BaseArtifactBooter to boot the &#39;Repository&#39; artifact type. Discovered repositories are bound using <code>app.repository()</code> which must be added to an Application using the <code>RepositoryMixin</code> from <code>@loopback/repository</code>.</p> </p> <p><p>Supported phases: configure, discover, load</p> </p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="141"></a> <h4 class="code-ref">load() : Promise</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Uses super method to get a list of Artifact classes. Boot each class by binding it to the application using <code>app.repository(repository);</code> if present.</p> </p> <p></p> </div> </section> <section class="code-doc "> <a name="RepositoryDefaults"></a> <h3 class="code-ref">Object literal: RepositoryDefaults</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Default ArtifactOptions for RepositoryBooter.</p> </p> <p></p> </div> </section> <section class="code-doc"> <div class="code-arguments-hdr">Variables</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name">dirs</strong> </td> <td class="code-arg-types"> <code></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Default ArtifactOptions for RepositoryBooter.</p> </p> <p></p> </div> </td> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name">extensions</strong> </td> <td class="code-arg-types"> <code></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Default ArtifactOptions for RepositoryBooter.</p> </p> <p></p> </div> </td> </tr> <tr class="code-arg"> <td> <a name=""></a> <strong class="code-arg-name">nested</strong> </td> <td class="code-arg-types"> <code>true</code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>Default ArtifactOptions for RepositoryBooter.</p> </p> <p></p> </div> </td> </tr> </table> </section> <section class="code-doc "> <a name="Bootstrapper"></a> <h3 class="code-ref">Class: bootstrapper = new Bootstrapper()</h3> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>The Bootstrapper class provides the <code>boot</code> function that is responsible for finding and executing the Booters in an application based on given options.</p> </p> <p><p>NOTE: Bootstrapper should be bound as a SINGLETON so it can be cached as it does not maintain any state of it&#39;s own.</p> </p> </div> </section> <section class="code-doc "> <a name="83"></a> <h4 class="code-ref">constructor(app: undefined, projectRoot: string, bootOptions: <a href="#BootOptions">BootOptions</a>) : Bootstrapper</h4> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-arguments-hdr">Arguments</div> <table class="params code-arguments"> <tr> <th class="hdr-name">Name</th> <th class="hdr-type">Type</th> <th class="hdr-desc">Description</th> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">app</strong> </td> <td class="code-arg-types"> <code></code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>The Bootstrapper class provides the <code>boot</code> function that is responsible for finding and executing the Booters in an application based on given options.</p> </p> <p><p>NOTE: Bootstrapper should be bound as a SINGLETON so it can be cached as it does not maintain any state of it&#39;s own.</p> </p> </div> </td> </tr> <tr class="code-arg"> <td> <strong class="code-arg-name">projectRoot</strong> </td> <td class="code-arg-types"> <code>string</code> </td> <td class="code-arg-desc"> <!-- Used for displaying comments in Class, Interface, Properties Constructor, Function and Parameters of constructor or function. (Excludes Type alias). --> <div class="code-desc"> <p><p>The Bootstrapper class provides the <code>boot</code> function that is responsible for finding and executing the Booters in a