Here are the steps to serve static files in our ASP.NET Core application.
1. Open the "NorthwindCafe.Web" project, then click on the "Startup.cs" file in the project. You will see the following markup in the Configure method
public void Configure(IApplicationBuilder app) { app.Run(async (context) => { await context.Response.WriteAsync("Hello World!"); }); }
2. Go into the Configure method, remove the existing code and type in the following code
public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseDefaultFiles(); app.UseStaticFiles(); }
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title></title> </head> <body> <h1>This a static file</h1> </body> </html>
github Repository: https://github.com/techjunkiejh/NorthwindCafe/tree/Hour2
Aivivu - đại lý chuyên vé máy bay trong nước và quốc tế
ReplyDeletevé máy bay đi Mỹ bao nhiêu tiền
vé máy bay từ mỹ về việt nam hãng eva
đăng ký bay từ canada về Việt Nam
vé máy bay nhật bản về việt nam
Máy bay từ Hàn Quốc về Việt Nam
Vé máy bay từ Đài Loan về VN
chuyen bay danh cho chuyen gia