I created a website with angular and .net framework 5.0. I published angular on Plesk and website is accessible and it's working fine (without backend) , but I'am having problem to publish .net framework app and connect it with angular.
AuthService.ts example :
private _loginUrl = "https://localhost:44365/api/Users/authenticate";
private _checkLogin = "https://localhost:44365/api/Users/userByUsername";
private _logoutUrl = "https://localhost:44365/api/Users/logout"
I watched tutorials about publishing .asp net ( Right Click Solution -> Publish , then copying it in file manager) , but when I host it I'am getting Error 404. Of coure, I don't have any .html pages or Views. Only models and controllers in .net api.
How to define connection strings in .net to bind on my online sql database which i created in Plesk and how to setup my angular so it can know and communicate with .net api I created?
localhost is only available on your computer and when you publish your application you have to change the base url as shown below according to the domain on which the asp.net project is published
const baseUrl="https://localhost:44365";
change to
const baseUrl="https://YOURASPDOTNETDOMAIN.com";
const authUrl=baseUrl+'/api/Users/authenticate';
That way, just change the baseUrl to localHost if you are developing