static void Main(string[] args) { SimpleWebServer.WebServer ws = new SimpleWebServer.WebServer(SendResponse, "http://localhost:8080/test/"); ws.Run(); Console.WriteLine("A simple webserver. Press a key to quit."); Console.ReadKey(); ws.Stop(); }
static void Main(string[] args) { WebServer ws = new WebServer(8090); ws.Run(); Console.WriteLine("A simple webserver. Press a key to quit."); Console.ReadKey(); ws.Stop(); }
static void Main(string[] args) { s_path = Environment.CurrentDirectory; Console.WriteLine("Path is : {0}", s_path); WebServer ws = new WebServer(SendResponse, "http://localhost:8080/"); ws.Run(); Console.WriteLine("A simple webserver. Press a key to quit."); Console.ReadKey(); ws.Stop(); }
public static void Main() { int Port = 1337; IAppRouteConfig routeConfig = new AppRouteConfig(); IApplication app = new MainApplication(); app.Configure(routeConfig); WebServer webServer = new WebServer(Port, routeConfig); webServer.Run(); }
static void Main(string[] args) { bool exit = false; for (int i = 0; i < args.Length; ++i) { switch (args[i]) { case "-token": case "-t": if(i < args.Length - 1) { ++i; accessToken = args[i].ToLower(); } break; case "-tg": case "-tokengen": accessToken = UUID.Random().ToString(); break; case "-l": case "-list": AutomatonCommand atm = new AutomatonCommand(); string[] lines = atm.classesList().Values.ToArray().OrderBy(q => q).ToArray(); File.WriteAllLines("automaton_commands.txt", lines, Encoding.UTF8); ServiceCommand svc = new ServiceCommand(); lines = svc.classesList().Values.ToArray(); File.WriteAllLines("service_commands.txt", lines, Encoding.UTF8); exit = true; break; case "-w": case "-web": webPage = true; break; } } Console.WriteLine("----==[Access Token]==----"); Console.WriteLine(accessToken); Console.WriteLine("--------------------------"); WebServer ws = null; if(!exit){ ws = new WebServer(GetHttpResponse, url); ws.Run(); Console.WriteLine("Starting Service on " + url + ". Press a key to quit."); } string arg; //#if DEBUG /* GridClient test = new GridClient() ; foreach (FieldInfo p in test.Settings.GetType().GetFields()) { if (p.GetValue(test.Settings) != null) { Console.WriteLine("{0} : {1}", p.Name, p.GetValue(test.Settings).ToString()); } } test = null; */ //Process.Start(url); //#endif timer = new Timer(timer_tick, null, 0, 1000); while (!exit) { arg = Console.ReadLine(); if (arg == "exit") exit = true; else if (arg == "help") Console.WriteLine("THIS APPLICATION USES A WEB API, USE IT FUCKWAD."); } if(ws != null)ws.Stop(); foreach (var pair in automatons) { pair.Value.Logout(); } timer.Dispose(); automatons.Clear(); }