markus / ConvertService / ServiceBase / FileDownloadSite / Startup.cs @ 6b24246c
이력 | 보기 | 이력해설 | 다운로드 (1.36 KB)
1 | 53c9637d | taeseongkim | 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 | f87dfb18 | taeseongkim | services.AddMvc(option=>option.EnableEndpointRouting = false); |
25 | 53c9637d | taeseongkim | } |
26 | |||
27 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. |
||
28 | f87dfb18 | taeseongkim | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) |
29 | 53c9637d | taeseongkim | { |
30 | app.UseDeveloperExceptionPage(); |
||
31 | f87dfb18 | taeseongkim | |
32 | 53c9637d | taeseongkim | app.UseMvc(routes => |
33 | { |
||
34 | routes.MapRoute( |
||
35 | name: "default", |
||
36 | template: "{controller=Home}/{action=Index}/{id?}"); |
||
37 | }); |
||
38 | } |
||
39 | } |
||
40 | } |