markus / ConvertService / ServiceBase / FileDownloadSite / Startup.cs @ f87dfb18
이력 | 보기 | 이력해설 | 다운로드 (1.36 KB)
1 |
using System; |
---|---|
2 |
using System.Collections.Generic; |
3 |
using System.IO; |
4 |
using System.Linq; |
5 |
using System.Threading.Tasks; |
6 |
using Microsoft.AspNetCore.Builder; |
7 |
using Microsoft.AspNetCore.Hosting; |
8 |
using Microsoft.AspNetCore.Http; |
9 |
using Microsoft.Extensions.DependencyInjection; |
10 |
using Microsoft.Extensions.FileProviders; |
11 |
|
12 |
namespace FileDownloadSite |
13 |
{ |
14 |
public class Startup |
15 |
{ |
16 |
// This method gets called by the runtime. Use this method to add services to the container. |
17 |
// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 |
18 |
public void ConfigureServices(IServiceCollection services) |
19 |
{ |
20 |
services.AddSingleton<IFileProvider>( |
21 |
new PhysicalFileProvider( |
22 |
Path.Combine(Environment.CurrentDirectory, "Files"))); |
23 |
|
24 |
services.AddMvc(option=>option.EnableEndpointRouting = false); |
25 |
} |
26 |
|
27 |
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. |
28 |
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) |
29 |
{ |
30 |
app.UseDeveloperExceptionPage(); |
31 |
|
32 |
app.UseMvc(routes => |
33 |
{ |
34 |
routes.MapRoute( |
35 |
name: "default", |
36 |
template: "{controller=Home}/{action=Index}/{id?}"); |
37 |
}); |
38 |
} |
39 |
} |
40 |
} |