Calling node app from angular

express
nodejs
angular

#1

Hello, I’m totally new to cloud9 and node/express.

I am trying to call the server and get a simple response out of it. Here is what I have:

server.js
`var express = require(‘express’);
var app = express();
var http = require(‘http’);
var server = http.createServer(express);

app.get(’/api/GetTest’, function (req, res) {
res.send(‘Hello World!’);
});

server.listen(process.env.PORT || 3000, process.env.IP || “0.0.0.0”, function(){
var addr = server.address();
console.log(“server listening at”, addr.address + “:” + addr.port);
});`

AngularController.js
`angular.module(‘app’).controller(‘mainController’, [’$scope’, ‘$http’, function($scope, $http){

var onTest = function (response) {
    alert(response.data);
}

$http.get('0.0.0.0:8080/api/GetTest').then(onTest);

}]);`

But I can simply not figure out what url to call. I don’t think “0.0.0.0” is correct. But what is and how to find out? I’d like to keep my nodejs in express format by the way. :slight_smile: