本文整理汇总了C#中IApplicationBuilder.UseWelcomePage方法的典型用法代码示例。如果您正苦于以下问题:C# IApplicationBuilder.UseWelcomePage方法的具体用法?C# IApplicationBuilder.UseWelcomePage怎么用?C# IApplicationBuilder.UseWelcomePage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IApplicationBuilder
的用法示例。
在下文中一共展示了IApplicationBuilder.UseWelcomePage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConfigurePrototype
public void ConfigurePrototype(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseWelcomePage("/welcome");
app.UseDeveloperExceptionPage();
app.UseDirectoryBrowser(new DirectoryBrowserOptions()
{
FileProvider = new PhysicalFileProvider(@"E:\GitHub\Fan.Chinese.MVC\src\Fan.Chinese.MVC\Properties"),
RequestPath = new PathString("/Properties")
});
app.UseStaticFiles();
app.UseStatusCodePagesWithRedirects("/NotFoundPage.html");
app.Run(async (context) =>
{
if (context.Request.Query.ContainsKey("throw")) throw new Exception("Exception triggered!");
context.Response.ContentType = "text/html";
await context.Response.WriteAsync($"<html><body><h2>Nihao {env.EnvironmentName}!</h2>");
await context.Response.WriteAsync("<ul>");
await context.Response.WriteAsync("<li><a href=\"/welcome\">Welcome Page</a></li>");
await context.Response.WriteAsync("<li><a href=\"/Properties\">Browse Property Directory</a></li>");
await context.Response.WriteAsync("<li><a href=\"/?throw=true\">Throw Exception</a></li>");
await context.Response.WriteAsync("</ul>");
await context.Response.WriteAsync("</body></html>");
});
}
示例2: Configure
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
{
loggerFactory.AddConsole();
app.UseIISPlatformHandler();
app.UseStaticFiles();
app.UseWelcomePage();
}
示例3: Configure
public void Configure(IApplicationBuilder app)
{
// Configure the pipeline to include MVC
app.UseMvc();
app.UseWelcomePage();
}
示例4: Configure
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
{
app.UseDeveloperExceptionPage();
app.UseMvcWithDefaultRoute();
app.UseWelcomePage("/welcome");
//app.UseRuntimeInfoPage("/info");
//app.UseIISPlatformHandler();
// Initialise ReactJS.NET. Must be before static files.
app.UseReact(config =>
{
// If you want to use server-side rendering of React components,
// add all the necessary JavaScript files here. This includes
// your components as well as all of their dependencies.
// See http://reactjs.net/ for more information. Example:
//config
// .AddScript("~/Scripts/First.jsx")
// .AddScript("~/Scripts/Second.jsx");
// If you use an external build too (for example, Babel, Webpack,
// Browserify or Gulp), you can improve performance by disabling
// ReactJS.NET's version of Babel and loading the pre-transpiled
// scripts. Example:
//config
// .SetLoadBabel(false)
// .AddScriptWithoutTransform("~/Scripts/bundle.server.js");
});
app.UseStaticFiles();
}
示例5: Configure
public void Configure(IApplicationBuilder app)
{
app.UseMvc();
app.UseSwagger();
app.UseSwaggerUi();
app.UseWelcomePage();
}
示例6: Configure
public void Configure(IApplicationBuilder app) {
// To test this sample with Postman, use the following settings:
//
// * Authorization URL: http://localhost:6500/connect/authorize
// * Access token URL: http://localhost:6500/connect/token
// * Client ID: postman
// * Client secret: [blank] (not used with public clients)
// * Scope: openid email profile roles
// * Grant type: authorization code
// * Request access token locally: yes
app.UseDeveloperExceptionPage();
app.UseStaticFiles();
app.UseOAuthValidation();
app.UseOpenIdConnectServer(options => {
options.Provider = new AuthorizationProvider();
// Enable the authorization and token endpoints.
options.AuthorizationEndpointPath = "/connect/authorize";
options.TokenEndpointPath = "/connect/token";
options.AllowInsecureHttp = true;
});
app.UseMvc();
app.UseWelcomePage();
}
示例7: Configure
public void Configure(IApplicationBuilder app)
{
app.UseErrorPage();
app.UseMvcWithDefaultRoute();
app.UseWelcomePage();
}
示例8: Configure
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (string.Equals(env.EnvironmentName, "Development", StringComparison.OrdinalIgnoreCase))
{
app.UseDeveloperExceptionPage();
app.UseRuntimeInfoPage(); // default path is /runtimeinfo
}
else
{
// specify production behavior for error handling, for example:
// app.UseExceptionHandler("/Home/Error");
// if nothing is set here, exception will not be handled.
}
app.UseWelcomePage("/welcome");
app.Run(async (context) =>
{
if(context.Request.Query.ContainsKey("throw")) throw new Exception("Exception triggered!");
context.Response.ContentType = "text/html";
await context.Response.WriteAsync("<html><body>Hello World!");
await context.Response.WriteAsync("<ul>");
await context.Response.WriteAsync("<li><a href=\"/welcome\">Welcome Page</a></li>");
await context.Response.WriteAsync("<li><a href=\"/?throw=true\">Throw Exception</a></li>");
await context.Response.WriteAsync("</ul>");
await context.Response.WriteAsync("</body></html>");
});
}
示例9: Configure
public void Configure(IApplicationBuilder app)
{
app.UseIISPlatformHandler();
app.UseMvcWithDefaultRoute();
app.UseWelcomePage();
}
示例10: Configure
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
{
loggerFactory.AddDebug();
app.UseApplicationInsightsRequestTelemetry();
app.UseApplicationInsightsExceptionTelemetry();
app.UseErrorHandler(a =>
{
a.UseMiddleware<ErrorMiddleware>();
});
app.UseWelcomePage("/welcome");
app.UseRuntimeInfoPage("/runtimeinfo");
//app.UseErrorPage();
app.Run(async (context) =>
{
if (context.Request.Query.ContainsKey("throw"))
throw new AggregateException("Some funny exception, 42");
await context.Response.WriteAsync("Hello World!");
});
}
示例11: Configure
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
{
loggerFactory.AddConsole();
app.UseMvcWithDefaultRoute();
app.UseWelcomePage();
}
示例12: Configure
public void Configure(IApplicationBuilder app, IApplicationLifetime lifetime, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
app.Map("/simplewebapi", (app1) => this.ConfigureIIS(app1, lifetime, env, loggerFactory));
app.UseMvc();
app.UseWelcomePage();
}
示例13: Configure
public void Configure(IApplicationBuilder app)
{
app.UseErrorPage();
app.UseMvc();
app.UseWelcomePage();
}
示例14: Configure
public void Configure(IApplicationBuilder app)
{
//app.Run(async (context) =>
//{
// await context.Response.WriteAsync("Hello World!");
//});
app.UseWelcomePage();
}
示例15: Configure
public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
{
//Standard configuration based on Microsofts supported Sample
loggerFactory.AddConsole();
app.UseErrorPage();
app.UseMvcWithDefaultRoute();
app.UseWelcomePage();
}