Пример #1
0
        public static IDisposable Start(SimpleConfiguration cfg, Action<IAppBuilder, SimpleConfiguration> builder)
        {
            var start = new StartOptions() {
                Port = cfg.Port
            };

            if(cfg.Url != null) {
                start.Urls.Add(cfg.Url);
            }

            if(cfg.ServerFactory != null) {
                start.ServerFactory = cfg.ServerFactory;
            }
              return WebApp.Start(start, app => builder(app, cfg));
        }
Пример #2
0
        public static IDisposable Start(SimpleConfiguration cfg, Action <IAppBuilder, SimpleConfiguration> builder)
        {
            var start = new StartOptions()
            {
                Port = cfg.Port
            };

            if (cfg.Url != null)
            {
                start.Urls.Add(cfg.Url);
            }

            if (cfg.ServerFactory != null)
            {
                start.ServerFactory = cfg.ServerFactory;
            }
            return(WebApp.Start(start, app => builder(app, cfg)));
        }
Пример #3
0
 public static IAppBuilder Map(IAppBuilder app, SimpleConfiguration cfg, string path, Action<IAppBuilder, SimpleConfiguration> callback)
 {
     return app.Map(path, sub => callback(sub, cfg));
 }
Пример #4
0
 public static IAppBuilder Map(IAppBuilder app, SimpleConfiguration cfg, string path, Action <IAppBuilder, SimpleConfiguration> callback)
 {
     return(app.Map(path, sub => callback(sub, cfg)));
 }