="https://github.com/franciscop/server-tutorial-todo" class="button">
    Github Repository
  </a>
</strong>



<h2 id="rest-api">REST API</h2>
<p>Let&#39;s first of all define our API. Let&#39;s keep it simple! Within index.js we write:</p>
<pre><code class="language-js">// index.js
const server = require(&#39;server&#39;);
const { get, post, put, del } = server.router;
const { render } = server.reply;
const todo = require(&#39;./todo.js&#39;);

// Render the homepage for `/`
const home = get(&#39;/&#39;, 