// 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, IApplicationLifetime applicationLifetime) { loggerFactory.AddConsole(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } // Create default server parameters var serverParameters = new NAServerParameters { DatabaseConfiguration = new NADatabaseConfiguration() }; // Bind configuration file data to server parameters config.Bind(serverParameters); // Create a server context from the parameters serverContext = NAServerConfigurator.CreateContext(serverParameters); // Register shutdown applicationLifetime.ApplicationStopping.Register(OnShutdown); // Load persistent state data NAServerConfigurator.LoadState(serverContext, ServerStateStorageFileName); app.UseOwin(x => x.UseNancy(opt => opt.Bootstrapper = new NABootstrapper(serverContext))); }
public NABootstrapper(NAServerContext serverContext) { ServerContext = serverContext; }