コード例 #1
0
 public TableController(Log4NetReaderContext context)
 {
     _context = context;
 }
コード例 #2
0
 public ValuesController(Log4NetReaderContext context)
 {
     _context = context;
 }
コード例 #3
0
ファイル: Startup.cs プロジェクト: mallek/Log4NetReader
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, Log4NetReaderContext context)
        {
            loggerFactory.AddConsole(Configuration.GetSection("Logging"));
            loggerFactory.AddDebug();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseCors(builder =>
                        builder.WithOrigins("http://localhost:4200"));

            app.Use(async(c, next) =>
            {
                await next();

                if (c.Response.StatusCode == 404 &&
                    !Path.HasExtension(c.Request.Path.Value) &&
                    !c.Request.Path.Value.StartsWith("/api/"))
                {
                    c.Request.Path = "/index.html";
                    await next();
                }
            });

            app.UseMvc();
            app.UseStaticFiles();

            // DbInitializer.Initialize(context);
        }