@loopback/docs
Version:
Documentation for LoopBack 4
333 lines (288 loc) • 17.7 kB
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-1">
<a href="#change-log">Change Log</a>
</li>
<li class="depth-1">
<a href="#0-4-0-https-github-com-strongloop-loopback-next-compare-loopback-example-todo-list-0-3-9-loopback-example-todo-list-0-4-0-2018-09-19">0.4.0</a>
</li>
<li class="depth-3">
<a href="#bug-fixes">Bug Fixes</a>
</li>
<li class="depth-3">
<a href="#features">Features</a>
</li>
<li class="depth-2">
<a href="#0-3-9-https-github-com-strongloop-loopback-next-compare-loopback-example-todo-list-0-3-8-loopback-example-todo-list-0-3-9-2018-09-14">0.3.9</a>
</li>
<li class="depth-2">
<a href="#0-3-8-https-github-com-strongloop-loopback-next-compare-loopback-example-todo-list-0-3-7-loopback-example-todo-list-0-3-8-2018-09-14">0.3.8</a>
</li>
<li class="depth-2">
<a href="#0-3-7-https-github-com-strongloop-loopback-next-compare-loopback-example-todo-list-0-3-6-loopback-example-todo-list-0-3-7-2018-09-14">0.3.7</a>
</li>
<li class="depth-3">
<a href="#bug-fixes-1">Bug Fixes</a>
</li>
<li class="depth-2">
<a href="#0-3-6-https-github-com-strongloop-loopback-next-compare-loopback-example-todo-list-0-3-5-loopback-example-todo-list-0-3-6-2018-09-12">0.3.6</a>
</li>
<li class="depth-2">
<a href="#0-3-5-https-github-com-strongloop-loopback-next-compare-loopback-example-todo-list-0-3-4-loopback-example-todo-list-0-3-5-2018-09-10">0.3.5</a>
</li>
<li class="depth-2">
<a href="#0-3-4-https-github-com-strongloop-loopback-next-compare-loopback-example-todo-list-0-3-3-loopback-example-todo-list-0-3-4-2018-09-08">0.3.4</a>
</li>
<li class="depth-3">
<a href="#bug-fixes-2">Bug Fixes</a>
</li>
<li class="depth-2">
<a href="#0-3-3-https-github-com-strongloop-loopback-next-compare-loopback-example-todo-list-0-3-2-loopback-example-todo-list-0-3-3-2018-08-25">0.3.3</a>
</li>
<li class="depth-2">
<a href="#0-3-2-https-github-com-strongloop-loopback-next-compare-loopback-example-todo-list-0-3-1-loopback-example-todo-list-0-3-2-2018-08-24">0.3.2</a>
</li>
<li class="depth-2">
<a href="#0-3-1-https-github-com-strongloop-loopback-next-compare-loopback-example-todo-list-0-3-0-loopback-example-todo-list-0-3-1-2018-08-15">0.3.1</a>
</li>
<li class="depth-1">
<a href="#0-3-0-https-github-com-strongloop-loopback-next-compare-loopback-example-todo-list-0-2-2-loopback-example-todo-list-0-3-0-2018-08-08">0.3.0</a>
</li>
<li class="depth-3">
<a href="#bug-fixes-3">Bug Fixes</a>
</li>
<li class="depth-3">
<a href="#features-1">Features</a>
</li>
<li class="depth-2">
<a href="#0-2-2-https-github-com-strongloop-loopback-next-compare-loopback-example-todo-list-0-2-1-loopback-example-todo-list-0-2-2-2018-07-21">0.2.2</a>
</li>
<li class="depth-2">
<a href="#0-2-1-https-github-com-strongloop-loopback-next-compare-loopback-example-todo-list-0-2-0-loopback-example-todo-list-0-2-1-2018-07-20">0.2.1</a>
</li>
<li class="depth-1">
<a href="#0-2-0-2018-07-20">0.2.0</a>
</li>
<li class="depth-3">
<a href="#features-2">Features</a>
</li>
<li class="depth-1">
<a href="#loopback-example-todo-list">@loopback/example-todo-list</a>
</li>
<li class="depth-2">
<a href="#overview">Overview</a>
</li>
<li class="depth-2">
<a href="#setup">Setup</a>
</li>
<li class="depth-2">
<a href="#tutorial">Tutorial</a>
</li>
<li class="depth-3">
<a href="#steps">Steps</a>
</li>
<li class="depth-2">
<a href="#try-it-out">Try it out</a>
</li>
<li class="depth-3">
<a href="#bugs-feedback">Bugs/Feedback</a>
</li>
<li class="depth-2">
<a href="#contributions">Contributions</a>
</li>
<li class="depth-2">
<a href="#tests">Tests</a>
</li>
<li class="depth-2">
<a href="#contributors">Contributors</a>
</li>
<li class="depth-2">
<a href="#license">License</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">
<a name="change-log"></a><h1>Change Log <small>v0.4.0</small></h1>
<p>All notable changes to this project will be documented in this file.
See <a href="https://conventionalcommits.org">Conventional Commits</a> for commit guidelines.</p>
<p><a name="0.4.0"></a></p>
<a name="0-4-0-https-github-com-strongloop-loopback-next-compare-loopback-example-todo-list-0-3-9-loopback-example-todo-list-0-4-0-2018-09-19"></a><h1><a href="https://github.com/strongloop/loopback-next/compare/@loopback/example-todo-list@0.3.9...@loopback/example-todo-list@0.4.0">0.4.0</a> (2018-09-19)</h1>
<a name="bug-fixes"></a><h3>Bug Fixes</h3>
<ul>
<li><strong>rest:</strong> return 404 when a model was not found (<a href="https://github.com/strongloop/loopback-next/commit/7a56bad">7a56bad</a>)</li>
</ul>
<a name="features"></a><h3>Features</h3>
<ul>
<li><strong>repository:</strong> rework *ById methods to throw if id not found (<a href="https://github.com/strongloop/loopback-next/commit/264f231">264f231</a>)</li>
</ul>
<p><a name="0.3.9"></a></p>
<a name="0-3-9-https-github-com-strongloop-loopback-next-compare-loopback-example-todo-list-0-3-8-loopback-example-todo-list-0-3-9-2018-09-14"></a><h2><a href="https://github.com/strongloop/loopback-next/compare/@loopback/example-todo-list@0.3.8...@loopback/example-todo-list@0.3.9">0.3.9</a> (2018-09-14)</h2>
<p><strong>Note:</strong> Version bump only for package @loopback/example-todo-list</p>
<p><a name="0.3.8"></a></p>
<a name="0-3-8-https-github-com-strongloop-loopback-next-compare-loopback-example-todo-list-0-3-7-loopback-example-todo-list-0-3-8-2018-09-14"></a><h2><a href="https://github.com/strongloop/loopback-next/compare/@loopback/example-todo-list@0.3.7...@loopback/example-todo-list@0.3.8">0.3.8</a> (2018-09-14)</h2>
<p><strong>Note:</strong> Version bump only for package @loopback/example-todo-list</p>
<p><a name="0.3.7"></a></p>
<a name="0-3-7-https-github-com-strongloop-loopback-next-compare-loopback-example-todo-list-0-3-6-loopback-example-todo-list-0-3-7-2018-09-14"></a><h2><a href="https://github.com/strongloop/loopback-next/compare/@loopback/example-todo-list@0.3.6...@loopback/example-todo-list@0.3.7">0.3.7</a> (2018-09-14)</h2>
<a name="bug-fixes-1"></a><h3>Bug Fixes</h3>
<ul>
<li><strong>example-todo-list:</strong> add responses to controllers (<a href="https://github.com/strongloop/loopback-next/commit/bf32971">bf32971</a>)</li>
</ul>
<p><a name="0.3.6"></a></p>
<a name="0-3-6-https-github-com-strongloop-loopback-next-compare-loopback-example-todo-list-0-3-5-loopback-example-todo-list-0-3-6-2018-09-12"></a><h2><a href="https://github.com/strongloop/loopback-next/compare/@loopback/example-todo-list@0.3.5...@loopback/example-todo-list@0.3.6">0.3.6</a> (2018-09-12)</h2>
<p><strong>Note:</strong> Version bump only for package @loopback/example-todo-list</p>
<p><a name="0.3.5"></a></p>
<a name="0-3-5-https-github-com-strongloop-loopback-next-compare-loopback-example-todo-list-0-3-4-loopback-example-todo-list-0-3-5-2018-09-10"></a><h2><a href="https://github.com/strongloop/loopback-next/compare/@loopback/example-todo-list@0.3.4...@loopback/example-todo-list@0.3.5">0.3.5</a> (2018-09-10)</h2>
<p><strong>Note:</strong> Version bump only for package @loopback/example-todo-list</p>
<p><a name="0.3.4"></a></p>
<a name="0-3-4-https-github-com-strongloop-loopback-next-compare-loopback-example-todo-list-0-3-3-loopback-example-todo-list-0-3-4-2018-09-08"></a><h2><a href="https://github.com/strongloop/loopback-next/compare/@loopback/example-todo-list@0.3.3...@loopback/example-todo-list@0.3.4">0.3.4</a> (2018-09-08)</h2>
<a name="bug-fixes-2"></a><h3>Bug Fixes</h3>
<ul>
<li>remove extra imports for mixin dependencies (<a href="https://github.com/strongloop/loopback-next/commit/35b916b">35b916b</a>)</li>
</ul>
<p><a name="0.3.3"></a></p>
<a name="0-3-3-https-github-com-strongloop-loopback-next-compare-loopback-example-todo-list-0-3-2-loopback-example-todo-list-0-3-3-2018-08-25"></a><h2><a href="https://github.com/strongloop/loopback-next/compare/@loopback/example-todo-list@0.3.2...@loopback/example-todo-list@0.3.3">0.3.3</a> (2018-08-25)</h2>
<p><strong>Note:</strong> Version bump only for package @loopback/example-todo-list</p>
<p><a name="0.3.2"></a></p>
<a name="0-3-2-https-github-com-strongloop-loopback-next-compare-loopback-example-todo-list-0-3-1-loopback-example-todo-list-0-3-2-2018-08-24"></a><h2><a href="https://github.com/strongloop/loopback-next/compare/@loopback/example-todo-list@0.3.1...@loopback/example-todo-list@0.3.2">0.3.2</a> (2018-08-24)</h2>
<p><strong>Note:</strong> Version bump only for package @loopback/example-todo-list</p>
<p><a name="0.3.1"></a></p>
<a name="0-3-1-https-github-com-strongloop-loopback-next-compare-loopback-example-todo-list-0-3-0-loopback-example-todo-list-0-3-1-2018-08-15"></a><h2><a href="https://github.com/strongloop/loopback-next/compare/@loopback/example-todo-list@0.3.0...@loopback/example-todo-list@0.3.1">0.3.1</a> (2018-08-15)</h2>
<p><strong>Note:</strong> Version bump only for package @loopback/example-todo-list</p>
<p><a name="0.3.0"></a></p>
<a name="0-3-0-https-github-com-strongloop-loopback-next-compare-loopback-example-todo-list-0-2-2-loopback-example-todo-list-0-3-0-2018-08-08"></a><h1><a href="https://github.com/strongloop/loopback-next/compare/@loopback/example-todo-list@0.2.2...@loopback/example-todo-list@0.3.0">0.3.0</a> (2018-08-08)</h1>
<a name="bug-fixes-3"></a><h3>Bug Fixes</h3>
<ul>
<li><strong>cli:</strong> install dependencies for clones examples (<a href="https://github.com/strongloop/loopback-next/commit/5774f1f">5774f1f</a>)</li>
<li><strong>cli:</strong> remove deleteAll endpoint from REST Controller template (<a href="https://github.com/strongloop/loopback-next/commit/34eba34">34eba34</a>)</li>
</ul>
<a name="features-1"></a><h3>Features</h3>
<ul>
<li><strong>cli:</strong> use <code>app.restServer.url</code> for console logs (<a href="https://github.com/strongloop/loopback-next/commit/f31160c">f31160c</a>)</li>
</ul>
<p><a name="0.2.2"></a></p>
<a name="0-2-2-https-github-com-strongloop-loopback-next-compare-loopback-example-todo-list-0-2-1-loopback-example-todo-list-0-2-2-2018-07-21"></a><h2><a href="https://github.com/strongloop/loopback-next/compare/@loopback/example-todo-list@0.2.1...@loopback/example-todo-list@0.2.2">0.2.2</a> (2018-07-21)</h2>
<p><strong>Note:</strong> Version bump only for package @loopback/example-todo-list</p>
<p><a name="0.2.1"></a></p>
<a name="0-2-1-https-github-com-strongloop-loopback-next-compare-loopback-example-todo-list-0-2-0-loopback-example-todo-list-0-2-1-2018-07-20"></a><h2><a href="https://github.com/strongloop/loopback-next/compare/@loopback/example-todo-list@0.2.0...@loopback/example-todo-list@0.2.1">0.2.1</a> (2018-07-20)</h2>
<p><strong>Note:</strong> Version bump only for package @loopback/example-todo-list</p>
<p><a name="0.2.0"></a></p>
<a name="0-2-0-2018-07-20"></a><h1>0.2.0 (2018-07-20)</h1>
<a name="features-2"></a><h3>Features</h3>
<ul>
<li><strong>example-todo-list:</strong> add TodoList package/tutorial (<a href="https://github.com/strongloop/loopback-next/commit/306d437">306d437</a>)</li>
</ul>
<a name="loopback-example-todo-list"></a><h1>@loopback/example-todo-list</h1>
<p>This is an extended tutorial that builds on top of <code>@loopback/example-todo</code>.</p>
<a name="overview"></a><h2>Overview</h2>
<p>This tutorial demonstrates how to create a set of APIs for models that are
related to one another.</p>
<p><img src="https://loopback.io/pages/en/lb4/imgs/todo-list-overview.png" alt="todo-tutorial-overview"></p>
<a name="setup"></a><h2>Setup</h2>
<p>If you're following from the tutorial in <code>@loopback/example-todo</code>, you can jump
straight to our first step:
<a href="http://loopback.io/doc/en/lb4/todo-list-tutorial-model.html">Add TodoList model</a></p>
<p>If not, you'll need to make sure you have a couple of things installed before we
get started:</p>
<ul>
<li><a href="https://nodejs.org/en/">Node.js</a> at v8.9 or greater</li>
</ul>
<p>Next, you'll need to install the LoopBack 4 CLI toolkit:</p>
<pre><code class="lang-sh">npm i -g @loopback/cli</code></pre>
<p>We recommend that you start with the
<a href="http://loopback.io/doc/en/lb4/todo-tutorial.html">todo tutorial</a> if you're not
familiar with LoopBack4, but if you are and don't want to start from scratch
again, you can use the LoopBack 4 CLI tool to catch up to where this tutorial
will continue from:</p>
<pre><code class="lang-sh">lb4 example todo-list</code></pre>
<p>It should be noted that this tutorial does not assume the
<a href="https://loopback.io/doc/en/lb4/todo-tutorial-geocoding-service.html">optional geo-coding step</a>
has been completed. Whether the step has been completed or not, the content and
the steps listed in this tutorial remain the same.</p>
<a name="tutorial"></a><h2>Tutorial</h2>
<p>Once you're ready to start the tutorial, let's begin by
<a href="http://loopback.io/doc/en/lb4/todo-list-tutorial-model.html">adding a TodoList model</a></p>
<a name="steps"></a><h3>Steps</h3>
<ol>
<li><a href="http://loopback.io/doc/en/lb4/todo-list-tutorial-model.html">Add TodoList Model</a></li>
<li><a href="http://loopback.io/doc/en/lb4/todo-list-tutorial-repository.html">Add TodoList Repository</a></li>
<li><a href="http://loopback.io/doc/en/lb4/todo-list-tutorial-controller.html">Add TodoList and TodoList's Todo Controller</a></li>
</ol>
<a name="try-it-out"></a><h2>Try it out</h2>
<p>If you'd like to see the final results of this tutorial as an example
application, follow these steps:</p>
<ol>
<li><p>Run the <code>lb4 example</code> command to select and clone the todo repository:</p>
<pre><code class="lang-sh">$ lb4 example
? What example would you like to <span class="hljs-built_in">clone</span>? (Use arrow keys)
todo: Tutorial example on how to build an application with LoopBack 4.
❯ todo-list: Continuation of the todo example using relations <span class="hljs-keyword">in</span> LoopBack 4.
hello-world: A simple hello-world Application using LoopBack 4.
<span class="hljs-built_in">log</span>-extension: An example extension project <span class="hljs-keyword">for</span> LoopBack 4.
rpc-server: A basic RPC server using a made-up protocol.</code></pre>
</li>
<li><p>Switch to the directory.</p>
<pre><code class="lang-sh"><span class="hljs-built_in">cd</span> loopback4-example-todo-list</code></pre>
</li>
<li><p>Finally, start the application!</p>
<pre><code class="lang-sh">$ npm start
Server is running on port 3000</code></pre>
</li>
</ol>
<p>Feel free to look around in the application's code to get a feel for how it
works. If you're interested in how it's been built or why we do things a certain
way, then continue on with this tutorial!</p>
<a name="bugs-feedback"></a><h3>Bugs/Feedback</h3>
<p>Open an issue in <a href="https://github.com/strongloop/loopback-next">loopback-next</a>
and we'll take a look!</p>
<a name="contributions"></a><h2>Contributions</h2>
<ul>
<li><a href="https://github.com/strongloop/loopback-next/blob/master/docs/CONTRIBUTING.md">Guidelines</a></li>
<li><a href="https://github.com/strongloop/loopback-next/issues/110">Join the team</a></li>
</ul>
<a name="tests"></a><h2>Tests</h2>
<p>Run <code>npm test</code> from the root folder.</p>
<a name="contributors"></a><h2>Contributors</h2>
<p>See
<a href="https://github.com/strongloop/loopback-next/graphs/contributors">all contributors</a>.</p>
<a name="license"></a><h2>License</h2>
<p>MIT</p>
</div>
<div class="intentionally-left-blank"></div>
</div>
</div>
<script src="js/vendor/jquery-1.10.1.min.js"></script>
<script src="js/vendor/jquery.scrollTo-1.4.3.1.js"></script>
<script src="js/vendor/bootstrap.min.js"></script>
<script src="js/main.js"></script>
</body>
</html>