Home > Enterprise >  ASP.NET Core with React.JS How to open separate Browser for the Backend?
ASP.NET Core with React.JS How to open separate Browser for the Backend?

Time:05-18

I've created an "ASP.NET core with React.Js" project :

enter image description here

And when I'm running it, it waits a while then redirects me to the front-end page which makes me not able to have the back-end browser(I need it to play with SwaggerUI and other stuff): enter image description here

The question is: how can I make both browsers open? I mean a browser for the front-end "http://localhost:46432" and one for the back-end as well "https://localhost:7211".

And thank you in advance.

CodePudding user response:

Download NuGet dependecy:

Swashbuckle.AspNetCore

Adding the following lines to Program.cs:

builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
...
app.UseSwagger();
app.UseSwaggerUI();

then from the browser call the backend URL swagger: https://localhost:7211/swagger

  • Related