Я пытаюсь запросить http.get () к node.js из angular в institute.ts.
import {Http} from "@angular/http";
export class InstituteListPage {
data: any =[];
constructor(private http:Http) {
this.getData();
}
getData(){
let URL = "http//localhost:3005/institute";
console.log(URL);
this.http.get(URL).subscribe(data => { console.log("****************" ,data)},
err => {
let alert = this.AlertC.create(
{
title:"ERROR",
message:err,
buttons: [
{
text:"OK",
role:"cancel"
}
]
}
);
alert.present();
})
}
}
Когда я запускаю этот код, я получаю
GET http://localhost:8100/http//localhost:3005/institute 404
(не найдено)
в то время какHTTP post запрос работает нормально
Как мне это сделать?