Ejemplo n.º 1
0
        public Controller(Router router, Database<Entity> database)
        {
            this.db = database;

            Action<string, Func<IOwinContext, IDictionary<string, string>, Task>> add = router.Add;
            add("/", Index);
            add("/key/:key", Key);
            add("/search/:from/:to", Search);
        }
Ejemplo n.º 2
0
        public void Configuration(IAppBuilder app)
        {
            var path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;

            var database = new Database<Entity>(Path.Combine(path, "database"));

            var router = new Router();
            new Controller(router, database);
            new WebServer(router).Configure(app);
        }
Ejemplo n.º 3
0
 public WebServer(Router router)
 {
     this.Router = router;
 }