title: What is 'API first architecture' in modern web application
body: <p>I try to understand the API first architecture to apply on web application, and found out some info here, <a href="https://stackoverflow.com/questions/27963676/advantages-of-a-separate-rest-backend-api">Advantages of a separate REST backend API?</a></p>
  
  <p>Below I attach an example for better answer of the questions.
  I start using Angular.js for front-end. Node.js, Express.js for server.</p>
  
  <p>folder structure</p>
  
  <pre><code>|-- server.js
  |-- app
          |-- models
          |-- views
              |-- index.html
              |-- about.html
              |-- contact.html
          |-- controllers
              |-- app.js
  |-- node-modules
  </code></pre>
  
  <p>app folder is a MVC structure for angular app. All of the POST GET PUT DELETE, MongoDB, Redis connection are in server.js. But when the server file get bigger, what is the best way to organize those business logic? </p>
  
  <p>There is no view engine set on server.js. If I create "routes" folder in express, is this actual carry out an API first concept? Let's say, when user clicks a button to submit a form from browser directly, in this case, is server responsible for presentation layer? </p>
  
  <p>index.html</p>
  
  <pre><code> &lt;form method='POST' action='/register'&gt;
       // some code here..
      &lt;button type='submit'&gt;submit&lt;/button&gt;&lt;/form&gt;
  </code></pre>
  
  <p>server.js</p>
  
  <pre><code>var rootPath = './app/views' 
  router.post('/register' (req, res) =&gt;{
    // some code here...
  res.sendFile( rootPath + 'index.html');
  }); 
  </code></pre>
  
  <p>Thanks in advance. </p>