title: What is the different between a Controller and Plug in Elixir Phoenix?
body: <p>Coming from Node.js/Express background, I see that <code>plug</code> is basically an equivalent to middleware in Phoenix framework. After reading about <code>Controllers</code>, I notices that <code>Controller</code> is also a <code>Plug</code> which themselves can contain one or more plugs.</p>
  <p>I am confused exactly about the usage of Plug and Controller.</p>
  <ul>
  <li>Plug enables composition. How is that different from normal function composition</li>
  <li>What is the difference between a Plug and a Controller? When to use what since I can do early exit from Plug as well?</li>
  <li>Finally, controller has <code>Actions</code>. These actions again have same signature as that of a <strong>function based Plug</strong>. So how an action is different from a Plug?</li>
  </ul>