Exemple #1
0
        // 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 OMServerParameters
            {
                OMConfig = new OMDatabaseConfiguration()
            };

            // Bind configuration file data to server parameters
            _config.Bind(serverParameters);
            // Create a server context from the parameters
            _serverContext = OMServerConfigurator.CreateContext(serverParameters);
            // Load persistent state data
            OMServerConfigurator.LoadState(_serverContext, ServerStateStorageFileName);

            // Register shutdown
            applicationLifetime.ApplicationStopping.Register(OnShutdown);

            app.UseOwin(x => x.UseNancy(opt => opt.Bootstrapper = new OMCoreServerBootstrapper(_serverContext)));
        }
Exemple #2
0
 public OMCoreServerBootstrapper(OMServerContext serverContext)
 {
     OMServerContext = serverContext;
 }