0
闊歩UIのエンドポイントは(ドメイン名を除く)ステージングでDEVと同じではありませんIISサイトが仮想ディレクトリ闊歩UIのエンドポイント内
IISの設定
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
app.UseSwagger(c=>
{
//Change the path of the end point , should also update UI middle ware for this change
c.RouteTemplate = "api-docs/{documentName}/swagger.json";
});
app.UseSwaggerUI(c =>
{
//Include virtual directory if site is configured so
c.SwaggerEndpoint(Configuration["Appsettings:VirtualDirectory"]+"api-docs/v1/swagger.json", "Api v1");
});
services.AddSwaggerGen(c =>
{
var xmlDocPath = Path.Combine(PlatformServices.Default.Application.ApplicationBasePath, "Api.xml");
c.IncludeXmlComments(xmlDocPath);
c.DescribeAllEnumsAsStrings();
開発
"AppSettings": {
"VirtualDirectory": "/"
}
ステージング
"AppSettings": {
"VirtualDirectory": "/Api/"
}
http://localhost:5001/api-docs/v1/swagger.json
が、ステージングサーバ上の同一の一方のステージングとDEVマシン上でUIのエンドポイント
http://xxxx:5002/swagger/Api/api-docs/v1/swagger.json
の代わりに、(それがどうあるべきか)
http://xxxx:5002/Api/api-docs/v1/swagger.json
あなたが間違っているように見えるように、envをステージングの開発マシンとして設定する方法を示します。あなたは 'ASPNETCORE_ENVIRONMENT'変数を' Staging'か、あなたが使ったものに設定しましたか? – Set
正確には、ASPNETCORE_ENVIRONMENT変数。 – Jay