{% extends "includes/base-layout.twig" %}

{% block title %}Class: ModelAPIExpress | Merest{% endblock %}
{% block content %}
    <h1 class="page-title">Class: ModelAPIExpress</h1>






    <section>

    <header>

            <h2>ModelAPIExpress</h2>

                <div class="class-description">ModelAPIExpress - Express application that provides an RESTfull API for different models</div>


    </header>

    <article>
      <div class="container-overview">




      <h2>Constructor</h2>


      <h4 class="name" id="ModelAPIExpress"><span class="type-signature"></span>new ModelAPIExpress<span class="signature">(options<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="ModelAPIExpress.html">ModelAPIExpress</a>}</span></h4>













      <h5>Parameters:</h5>


  <table class="params">
      <thead>
      <tr>

          <th>Name</th>


          <th>Type</th>


          <th>Attributes</th>




          <th class="last">Description</th>
      </tr>
      </thead>

      <tbody>


          <tr>

                  <td class="name"><code>options</code></td>


              <td class="type">


  <span class="param-type">Object</span>



              </td>


                  <td class="attributes">

                      &lt;optional><br>





                  </td>




              <td class="description last">API configuration parameters
                  <h6>Properties</h6>


  <table class="params">
      <thead>
      <tr>

          <th>Name</th>


          <th>Type</th>


          <th>Attributes</th>




          <th class="last">Description</th>
      </tr>
      </thead>

      <tbody>


          <tr>

                  <td class="name"><code>title</code></td>


              <td class="type">


  <span class="param-type">String</span>



              </td>


                  <td class="attributes">





                  </td>




              <td class="description last">the title of API <SWAGGER></td>
          </tr>



          <tr>

                  <td class="name"><code>version</code></td>


              <td class="type">


  <span class="param-type">String</span>



              </td>


                  <td class="attributes">





                  </td>




              <td class="description last">the version of API <SWAGGER></td>
          </tr>



          <tr>

                  <td class="name"><code>path</code></td>


              <td class="type">


  <span class="param-type">String</span>



              </td>


                  <td class="attributes">





                  </td>




              <td class="description last">the path of api root. The application doesn't mount it self on this path. <SWAGGER></td>
          </tr>



          <tr>

                  <td class="name"><code>host</code></td>


              <td class="type">


  <span class="param-type">String</span>



              </td>


                  <td class="attributes">





                  </td>




              <td class="description last">the host to reach API. <SWAGGER></td>
          </tr>



          <tr>

                  <td class="name"><code>options</code></td>


              <td class="type">


  <span class="param-type">Boolean</span>



              </td>


                  <td class="attributes">

                      &lt;optional><br>





                  </td>




              <td class="description last">allows or denies the OPTION end-point on the application level</td>
          </tr>



          <tr>

                  <td class="name"><code>transformResponse</code></td>


              <td class="type">


  <span class="param-type">function</span>



              </td>


                  <td class="attributes">

                      &lt;optional><br>





                  </td>




              <td class="description last">the function to transform standard response. For details see Transform response</td>
          </tr>


      </tbody>
  </table>

              </td>
          </tr>


      </tbody>
  </table>






  <dl class="details">


























      <dt class="tag-source">Source:</dt>
      <dd class="tag-source"><ul class="dummy"><li>
          <a href="model-api-app.js.html">model-api-app.js</a>, <a href="model-api-app.js.html#line26">line 26</a>
      </li></ul></dd>







  </dl>













  <h5>Returns:</h5>


  <div class="param-desc">
      Created API application
  </div>



  <dl>
      <dt>
          Type
      </dt>
      <dd>

  <span class="param-type"><a href="ModelAPIExpress.html">ModelAPIExpress</a></span>


      </dd>
  </dl>






      </div>












          <h3 class="subsection-title">Members</h3>



  <h4 class="name" id="SWAGGER_SUPPORT"><span class="type-signature"></span>SWAGGER_SUPPORT<span class="type-signature"></span></h4>




  <div class="description">
      SWAGGER_SUPPORT indicates that the module version supports the swagger
  </div>







  <dl class="details">


























      <dt class="tag-source">Source:</dt>
      <dd class="tag-source"><ul class="dummy"><li>
          <a href="model-api-app.js.html">model-api-app.js</a>, <a href="model-api-app.js.html#line63">line 63</a>
      </li></ul></dd>







  </dl>










          <h3 class="subsection-title">Methods</h3>






      <h4 class="name" id="expose"><span class="type-signature"></span>expose<span class="signature">(path<span class="signature-attributes">opt</span>, middleware<span class="signature-attributes">opt</span>, model, routerOptions<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {<a href="ModelAPIExpress.html">ModelAPIExpress</a>}</span></h4>





  <div class="description">
      ModelAPIExpress.prototype.expose - exposes the mongoose model as RESTFull json service
  </div>









      <h5>Parameters:</h5>


  <table class="params">
      <thead>
      <tr>

          <th>Name</th>


          <th>Type</th>


          <th>Attributes</th>




          <th class="last">Description</th>
      </tr>
      </thead>

      <tbody>


          <tr>

                  <td class="name"><code>path</code></td>


              <td class="type">


  <span class="param-type">String</span>



              </td>


                  <td class="attributes">

                      &lt;optional><br>





                  </td>




              <td class="description last">the path to mount exposed model</td>
          </tr>



          <tr>

                  <td class="name"><code>middleware</code></td>


              <td class="type">


  <span class="param-type">function</span>



              </td>


                  <td class="attributes">

                      &lt;optional><br>





                  </td>




              <td class="description last">one or more middlewares that should be called before each end-point controller</td>
          </tr>



          <tr>

                  <td class="name"><code>model</code></td>


              <td class="type">


  <span class="param-type">Mongoose.Model</span>



              </td>


                  <td class="attributes">





                  </td>




              <td class="description last">Mongoosee model to be exposed</td>
          </tr>



          <tr>

                  <td class="name"><code>routerOptions</code></td>


              <td class="type">


  <span class="param-type">Object</span>



              </td>


                  <td class="attributes">

                      &lt;optional><br>





                  </td>




              <td class="description last">ModelAPIRouter configuration object (see [Router configuration](configuration.html#router))</td>
          </tr>


      </tbody>
  </table>






  <dl class="details">


























      <dt class="tag-source">Source:</dt>
      <dd class="tag-source"><ul class="dummy"><li>
          <a href="model-api-app.js.html">model-api-app.js</a>, <a href="model-api-app.js.html#line74">line 74</a>
      </li></ul></dd>







  </dl>













  <h5>Returns:</h5>


  <div class="param-desc">
      itself
  </div>



  <dl>
      <dt>
          Type
      </dt>
      <dd>

  <span class="param-type"><a href="ModelAPIExpress.html">ModelAPIExpress</a></span>


      </dd>
  </dl>










      <h4 class="name" id="urls"><span class="type-signature"></span>urls<span class="signature">()</span><span class="type-signature"> &rarr; {Array}</span></h4>





  <div class="description">
      ModelAPIExpress.prototype.urls - returns avaliable list of end-points
  </div>













  <dl class="details">


























      <dt class="tag-source">Source:</dt>
      <dd class="tag-source"><ul class="dummy"><li>
          <a href="model-api-app.js.html">model-api-app.js</a>, <a href="model-api-app.js.html#line117">line 117</a>
      </li></ul></dd>







  </dl>













  <h5>Returns:</h5>


  <div class="param-desc">
      list of end-points
  </div>



  <dl>
      <dt>
          Type
      </dt>
      <dd>

  <span class="param-type">Array</span>


      </dd>
  </dl>










          </article>

    </section>




{% endblock %}
