Exemple #1
0
        public static async Task Main()
        {
            var http = new HttpServer(80);

            http.AddRoute(HttpMethodType.Get, "/", new HomeController().Index);
            http.AddRoute(HttpMethodType.Get, "/favicon.ico", new StaticFileController().Favicon);
            http.AddRoute(HttpMethodType.Get, "/Users/Login", new UsersController().Login);
            http.AddRoute(HttpMethodType.Get, "/Users/Register", new UsersController().Register);
            http.AddRoute(HttpMethodType.Get, "/AboutController", new AboutController().Index);
            http.AddRoute(HttpMethodType.Get, "/CardsController", new CardsController().Index);

            OpenBrowser("http://localhost/");
            await http.StartAsync();
        }
 static async Task Main(string[] args)
 {
     var httpServer = new HttpServer(80);
     await httpServer.StartAsync();
 }