Пример #1
0
        public static Options Parse( string[] args )
        {
            var options = new Options();
            Parser.Default.ParseArguments( args, options );

            if( !options.RootUrlIsSpecified() )
            {
                options.RootUrl = options.GetListenUrl().Replace( "*", "localhost" );
            }
            return options;
        }
Пример #2
0
        static void Main( string[] args )
        {
            Options = Library.WebApi.Options.Parse( args );

            if( IsRunningOnMono() )
            {
                ServiceBase[] ServicesToRun;
                ServicesToRun = new ServiceBase[] 
                { 
                    new Service()
                };
                ServiceBase.Run( ServicesToRun );
            }
            else
            {
                //so we don't have to bother installing/uninstalling services on windows
                Service svc = new Service();
                svc.OnDebug();
                LaunchDocumentation( Program.Options.RootUrl );
                Thread.Sleep( Timeout.Infinite );
            }
        }