public NoobotHost(IContainerFactory containerFactory, IMemoryLog memoryLog) { _containerFactory = containerFactory; _memoryLog = memoryLog; }
public NoobotHost(IContainerFactory containerFactory, IMemoryLog memoryLog) { _containerFactory = containerFactory; _memoryLog = memoryLog; }
public LogModule(IMemoryLog log) { Get["/log"] = _ => Response.AsJson(log.Messages); }
public LogModule(IMemoryLog log) { Get["/log"] = _ => Response.AsJson(log.Messages); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IApplicationLifetime applicationLifetime, IHostingEnvironment env, IMemoryLog log) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } var noobHost = new NoobotHost(new DotnetCoreConfigReader(Configuration.GetSection("bot"))); applicationLifetime.ApplicationStarted.Register(() => noobHost.Start(log)); applicationLifetime.ApplicationStopping.Register(noobHost.Stop); app.UseMvc(); app.UseStaticFiles(new StaticFileOptions() { FileProvider = new PhysicalFileProvider( Path.Combine(Directory.GetCurrentDirectory(), @"js")), RequestPath = new PathString("/js") }); app.Run(async context => { await context.Response.WriteAsync(string.Empty); }); }
public void Configure(IApplicationBuilder app, IApplicationLifetime applicationLifetime, IHostingEnvironment env, IMemoryLog log) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } var noobHost = new NoobotHost(new DotnetCoreConfigReader(Configuration.GetSection("Bot"))); applicationLifetime.ApplicationStarted.Register(() => noobHost.Start(log)); applicationLifetime.ApplicationStopping.Register(noobHost.Stop); app.Run(async context => { await context.Response.WriteAsync(string.Join(Environment.NewLine, log.FullLog())); }); }