Пример #1
0
		static int Main(string[] args)
		{
			var Args = new Arguments();
			if (Args.Parse(args))
			{
				Args.ShowParsedValues();
			}
			else
			{
				System.Console.WriteLine("Incorrect Command line Options.. Exiting");
				Args.ShowAllOptions();
				return 0; 
			}

			var Server = new HttpServer(Convert.ToInt32(Args.ServerPort),Args.ServerRoot, Args.UseAllPrefixes == "FALSE" ? false : true );
			Server.Run();

			if ( Args.Browser != "" )
			{
				if ((!File.Exists(Args.Browser) && !IsRunningOnMac()) || (!Directory.Exists(Args.Browser) && IsRunningOnMac()))
				{
					System.Console.WriteLine("Browser Not found, Please check -Browser= option");
					return 0;
				}
				SpawnBrowserAndBlock(Args);
			}
			else
			{
				System.Console.WriteLine("Press Any key Quit Server");
				System.Console.ReadKey();
			}

			Server.Stop();
			return 0;
		}