I have a node server running at port 8000
app.get('/historical/:days' ,(req,res,next){..}) How do I make a a request from angular(port 4200) from the browser to the node server? I do the following
makeRequest(): void { this.loading = true; this.http.get('http://localhost:8000/historical/:day') .subscribe(data => { this.data = data; console.log(this.data) this.loading = false; }); }
at the html side of angular:
<pre> <div> {{makeRequest()}} </div> </pre> When I type http://localhost:4200/historical/1, (where 1 represents historical data of the previous day) nothing happens
What to do?