简体   繁体   English

ASP.NET Core with React.JS 如何为后端打开单独的浏览器?

[英]ASP.NET Core with React.JS How to open separate Browser for the Backend?

I've created an " ASP.NET core with React.Js " project:我创建了一个“ ASP.NET core with React.Js ”项目:

在此处输入图像描述

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):当我运行它时,它会等待一段时间然后将我重定向到前端页面,这让我无法使用后端浏览器(我需要它来玩SwaggerUI和其他东西): 在此处输入图像描述

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".我的意思是前端浏览器“http://localhost:46432”和后端浏览器“https://localhost:7211”。

And thank you in advance.提前谢谢你。

Download NuGet dependecy:下载 NuGet 依赖:

Swashbuckle.AspNetCore虚张声势.AspNetCore

Adding the following lines to Program.cs:将以下行添加到 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然后从浏览器调用后端 URL+swagger: https://localhost:7211/swagger

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 依赖问题(ASP.NET Core + React.js) - Dependency problem (ASP.NET Core + React.js) 如何将 Asp.Net Core WebApi 与 React.js 集成? - how can I Integrate Asp.Net Core WebApi With React.js? 如何从前端 React.js 处理 ASP.NET 核心 web API 中的“未定义”或“空”? - How to handle "undefined" or "null" in ASP.NET Core web API from frontend React.js? 尝试使用 React.js 和 Redux 将 Azure B2c 身份验证添加到 Asp.net 核心 - trying to add Azure B2c authentication to Asp.net core with React.js and Redux 无法从 React.js (CORS) 访问 ASP.NET Core API - ASP.NET Core API not accessible from React.js (CORS) 全栈应用中基于角色的 Active Directory 身份验证和授权(React.js + ASP.Net Core) - Role-based Active Directory authentication and authorization in full stack app (React.js + ASP.Net Core) ASP.NET Core React项目模板-如何链接到C#后端 - ASP.NET Core React project template - how to link to C# backend 在新浏览器中打开 PDF 文件 ASP.NET Core 3 中的 window - Open PDF file in new browser window in ASP.NET Core 3 ASP.NET Core:创建和打开PDF(在浏览器中) - ASP.NET Core: Create and Open PDF (in browser) 使用 Asp.Net Core,如何将视图作为新的浏览器选项卡打开,然后稍后再关闭 - Using Asp.Net Core, how can I open a view as a new browser tab, and then close it again later
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM