I have two projects in a solutiion. Rather than creating a Single application using Angular template, I created two projects. One is Angular and one is Web API. SO what I did was in angular.json file I specified output path like this
"outputPath": "../../Cr_API/wwwroot",
So Whenever I build angular application it creates output files in my other API project's wwwroot folder. So in launchsettings.json file the api project I set the launchurl as
"launchUrl": "index.html",
So when the Web API application execute my Angular application loads as expected. But my question is about the API paths when calling. When executing the angular app separately my API calls like this
let url:string="https://localhost:44331";
return this.client.get(url+'/api/Locations', {
withCredentials: true,
responseType: 'json'
});
But since when building and running from API app itself, it doesnt need the full path since the call is local to that application. So how can I deal with it the best way. Somthing like Baseurl method is Angular template.