public static void Main(string[] args) { Console.WriteLine("hi"); //Db.MysqlDB.testDB(); SimpleHTTPServer webServer = new SimpleHTTPServer("/home/ubuntu/workspace/webSiteSample/CSharpSample", 8080); webServer.SetHandler("/TestHandler2", new TestHandler()); webServer.SetHandler("/TestHandler", new TestHandler()); webServer.SetHandler("/TestHandlerWithPara", new TestHandlerWithPara()); webServer.SetHandler("/loginVerify", new LoginVerify()); }
static void Main(string[] args) { string root = AppDomain.CurrentDomain.BaseDirectory; string text = System.IO.File.ReadAllText(root + "config.json"); JObject stuff = JObject.Parse(text); int port = Int32.Parse((string)stuff["port"]); string www = (string)stuff["www"]; string host = (string)stuff["host"]; SimpleHTTPServer myServer = new SimpleHTTPServer(root + www, host, port); var line = Console.ReadLine(); if (string.IsNullOrEmpty(line)) { myServer.Stop(); } }