1 Star 0 Fork 195

sanzk/ReZero

forked from 阿妮亚/ReZero 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Program.cs 1.46 KB
一键复制 编辑 原始数据 按行查看 历史
阿妮亚 提交于 2024-05-19 14:53 . Update test
using ReZero;
using ReZero.SuperAPI;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
var builder = WebApplication.CreateBuilder(args);
// Add services to the container.
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
//Register: Register the super API service
//注册:注册超级API服务
builder.Services.AddReZeroServices(api =>
{
//启用超级API
//有重载可换json文件
var apiObj = SuperAPIOptions.GetOptions();
apiObj!.DependencyInjectionOptions = new DependencyInjectionOptions(Assembly.GetExecutingAssembly());
//启用超级API
api.EnableSuperApi(apiObj);
});
var app = builder.Build();
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();
#if !DEBUG
try
{
// 假设您的应用程序在本地5000端口上运行
string url = "http://localhost:5000/rezero/dynamic_interface.html?InterfaceCategoryId=200100";
Process.Start(new ProcessStartInfo
{
FileName = url,
UseShellExecute = true
});
}
catch (global::System.Exception)
{
//docker中不能打开浏览器,出错不处理
}
#endif
// 启动默认的网页浏览器并打开指定的URL
app.Run();
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/sanzk/ReZero.git
git@gitee.com:sanzk/ReZero.git
sanzk
ReZero
ReZero
master

搜索帮助