static void Main(string[] args) { var webServer = new SimpleHttpServer("c:\\simpleWeb", 9050); //webServer. Console.WriteLine("Hosting c:\\simpleWeb on port 9050"); Console.WriteLine("Press any key to exit."); Console.ReadKey(); }
/// <summary> /// Internal method that instantiates the server instance /// </summary> /// <param name="parms"></param> private static void StartHttpServerThread(object parms) { if (Current != null) { StopHttpServerOnThread(); } var httpParms = parms as ServerStartParameters; Current = new SimpleHttpServer(httpParms.Path, httpParms.Port); Current.RequestHandler = httpParms.RequestHandler; }
/// <summary> /// Call this method to stop the Singleton instance of the server. /// </summary> public static void StopHttpServerOnThread() { Current.Stop(); Current = null; }