我在使用asp核心的visual studio服务结构中创建。 部署后,我看到你好世界。 我创建了控制器:
public class HomeController
{
[HttpGet("~api/home")]
public string Get()
{
return $"Hello from Service Fabric!. Log date: {DateTime.Now}";
}
}
改变功能,Hello world:
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
loggerFactory.AddConsole();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
/*app.Run(async (context) =>
{
await context.Response.WriteAsync("Hello World!");
});*/
app.UseCors("AllowSpecificOrigin");
app.UseMvc();
}
但我仍然看到Hello World。你有什么想法,它是如何解决的?