2

I have created new app using following command.

dotnet new angular

I have added new controller and want to test using Postman.

How can I find the address of API which is running locally after executing following command.

dotnet run

As I understand when I execute following command:

dotnet run

It start both applications (Angular, Web API) simultaneously.

When I go to localhost it shows the UI / Angular App.

I want to find URL of the API to test it before deployment using Postman.

2 Answers 2

2

dotnet run

It start both applications (Angular, Web API) simultaneously.

dotnet run runs only .net app. Run ng serve to run angular app.

To find the correct endpoint, check launchsettings.json from Properties folder. Under profiles >> applicationUrl you will see something like this:

"applicationUrl": "https://localhost:5000;http://localhost:5001"
Sign up to request clarification or add additional context in comments.

1 Comment

Indeed localhost:5000 was the endpoint I was looking for, Thanks. Now I encounter another issue, I can't find out what is the URL of deployed API. Where I can find it ?
1

When running command dotnet run in terminal, it should print something similar to

Now listening on: http://localhost:5000

That will be your back-end URL

1 Comment

That's correct, but I am getting two of those: Now listening on: http://localhost:7196 and Now listening on: http://localhost:5105 when I press any of those (crtl + enter), it opens a cmd and redirects me to localhost:44493 and shows Angular UI (website itself), it doesn't matter which one I press on, both does same. Once I press above links In the terminal it writes :info: Microsoft.AspNetCore.SpaProxy.SpaProxyLaunchManager[0] No SPA development server running at https://localhost:44493 found. and SPA proxy is not ready. Returning temporary landing page. UI works perfectly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.