mirror of
				https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
				synced 2025-10-31 02:05:33 +00:00 
			
		
		
		
	Initial replacement of old repository.
This commit is contained in:
		
							
								
								
									
										64
									
								
								HaLive/Startup.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										64
									
								
								HaLive/Startup.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,64 @@ | ||||
| using Microsoft.AspNetCore.Builder; | ||||
| using Microsoft.AspNetCore.Hosting; | ||||
| using Microsoft.AspNetCore.Http; | ||||
| using Microsoft.AspNetCore.Mvc; | ||||
| using Microsoft.Extensions.Configuration; | ||||
| using Microsoft.Extensions.DependencyInjection; | ||||
| using HaXMLReader; | ||||
| using HaXMLReader.Interfaces; | ||||
| using HaDocument.Interfaces; | ||||
| using Microsoft.AspNetCore.Diagnostics; | ||||
|  | ||||
| namespace HaLive | ||||
| { | ||||
|     public class Startup | ||||
|     { | ||||
|         public Startup(IConfiguration configuration) | ||||
|         { | ||||
|             Configuration = configuration; | ||||
|         } | ||||
|  | ||||
|         public IConfiguration Configuration { get; } | ||||
|  | ||||
|         // This method gets called by the runtime. Use this method to add services to the container. | ||||
|         public void ConfigureServices(IServiceCollection services) | ||||
|         { | ||||
|  | ||||
|             services.AddMvc() | ||||
|                  //.AddRazorPagesOptions(options => | ||||
|                  //{ | ||||
|                  //    options.RootDirectory = "/Pages/Main"; | ||||
|                  //    options.Conventions.Folder | ||||
|                  //}) | ||||
|                 .SetCompatibilityVersion(CompatibilityVersion.Version_2_2); | ||||
|              | ||||
|             services.AddSingleton<ILibrary>(x => HaDocument.Document.Create(new Options())); | ||||
|             services.AddTransient<IReaderService, ReaderService>(); | ||||
|         }    | ||||
|         | ||||
|  | ||||
|         // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. | ||||
|         public void Configure(IApplicationBuilder app, IHostingEnvironment env) | ||||
|         { | ||||
|             if (env.IsDevelopment()) | ||||
|             { | ||||
|                 app.UseDeveloperExceptionPage(); | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 app.UseExceptionHandler("/Error"); | ||||
|                 // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. | ||||
|                 app.UseHsts(); | ||||
|             } | ||||
|             app.UseStaticFiles(); | ||||
|             app.UseMvc(); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     class Options : IHaDocumentOptions { | ||||
|         public string HamannXMLFilePath { get; set; } = @"Hamann.xml"; | ||||
|         public string[] AvailableVolumes { get; set; } = { "1", "2", "3", "4", "5", "6", "7" }; | ||||
|         public bool NormalizeWhitespace { get; set; } = true; | ||||
|         public (int, int) AvailableYearRange {get; set; } = (1751, 1788); | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 Simon Martens
					Simon Martens