How to use external rest api in Sails js (nodejs MVC)
问题 Im using sailsjs as a MVC for node js, i'm still learning it. I managed to get data from my own database and use it. But now i need/want to get data from an external rest api. I used this in my controller: // api/controllers/SomeController.js test : function(res,req){ var j; var https = require('https'); var options = { hostname: 'testing.atlassian.net', port: 443, path: '/rest/api/2/search?jql=project=ABC', method: 'GET', headers: {'Authorization': 'Basic ' + 'SuperSecretLoginAndPassword'} }