title: Get request Ember.js on Sails.js
body: <p>I am creating a web application using <a href="http://sanestack.com/" rel="nofollow noreferrer" title="Sane stack">Sane stack</a>, which uses Ember.js on the client side as a JavaScript framework, and on the server side it uses Sails.js as a node.js framework.  I structured my application architecture as follows: </p>
  
  <p><img src="https://i.stack.imgur.com/Nr8Ru.png" alt="enter image description here"></p>
  
  <p>I  am trying to get some data from the Jira API REST, I can, for example, GET a Project's information from the JIRA API REST with sails.js using a simple controller : </p>
  
  <pre><code>//server/app/controllers/JiraController
  module.exports = {
      loadProject : function(req, res){
          console.log("Jira contoller");
          var Http = require('machinepack-http');
          process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
          Http.sendHttpRequest({
              url: '/rest/api/2/project/',
              baseUrl: 'https://jira.domain.com',
              method: 'get',
              headers: {
                "Authorization": "Basic YWxhYS52654f0bWFuaTphbGFhNDE0NA=="
              }
          }).exec({
              serverError: function(result) {
                  res.send("server error" + JSON.stringify(result));
              },
              success: function(result) {
               // res.send("Projects loaded successfully");
               res.send(result);
              }
          });
      }    
  };
  </code></pre>
  
  <p>In server/app/config/routes : I add : </p>
  
  <pre><code>'get /projects' : 'JiraController.loadProject'
  </code></pre>
  
  <p>But what I want to do is get the Project data on the client side with Ember.js, in other words, I want that sails.js request the JIRA API Rest, and then pass the data (JSON) to Ember.js which will display it in a View.</p>
  
  <p>How can I do that please !?</p>
  
  <p>EDIT : </p>
  
  <p>In the client side I did this : </p>
  
  <p>//pods/components/project/component.js</p>
  
  <pre><code>import Ember from 'ember';
  
  export default Ember.Route.extend({
    model() {
      return Ember.$.getJSON('/api/v1/projects');
    }
  });
  </code></pre>
  
  <p>How can I render this JSON in my view ?</p>