从Angular调用Rest服务时出错404

时间:2017-09-08 07:47:34

标签: node.js httpserver

当我在浏览器上运行我的服务器时,它显示未找到响应。我试过Firefox,Safari,Chrome等。但没有任何改进。它表示响应未定义。当我运行我的http服务器时,it fails打开该页面。它将直接跳转到文件夹路径并在本地访问Html,但它没有从服务器提供...

这是我的代码:

mod.controller('contacts',contacts);
function contacts(contactsdata){ 
contactsdata.getcontacts()      
.then(function(data){
    this.contacts = data;
})
mod.service("contactsdata",function($http){   
   this.getcontacts = function(){               
        var execute1 = $http.get('http://localhost:3000/contactsinfo')
        var execute2 = execute1.then(function(response){
                return response.data;
            });
                return execute2;
        }
});

0 个答案:

没有答案