Exemplo n.º 1
0
 public ServiceHost(string webApiBaseUrl)
 {
     if (String.IsNullOrWhiteSpace(webApiBaseUrl))
     {
         throw new ArgumentException("webApiBaseUrl");
     }
     _webApiHost = new WebApiHost(webApiBaseUrl, DI.ServicesContainer.Resolve <ILifetimeScope>());
 }
Exemplo n.º 2
0
        public static void Start(string url)
        {
            ClearDirectory(ConfigurationManager.AppSettings["PointsLocation"]);
            ClearDirectory(ConfigurationManager.AppSettings["SquaresLocation"]);

            if (_webApiHost == null)
            {
                _webApiHost = new WebApiHost(url, Container);
                _webApiHost.Start();
            }
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            webApiHost = new WebApiHost();

            Console.WriteLine("Listening on http://localhost:5050/command/start");
            Console.WriteLine("Listening on http://localhost:5050/command/stop");
            Console.WriteLine("Listening on http://localhost:5050/command/custom");
            Console.WriteLine();
            Console.WriteLine("Running Tests");
            Console.WriteLine();
            Console.WriteLine("Starting: " + new WebClient().DownloadString("http://localhost:5050/command/start"));
            Console.WriteLine("Stopping: " + new WebClient().DownloadString("http://localhost:5050/command/stop"));
            Console.WriteLine("Custom: " + new WebClient().DownloadString("http://localhost:5050/command/custom"));
            Console.WriteLine();
            Console.WriteLine("Press any key to terminate");
            Console.ReadKey();

            Console.WriteLine("Terminating");
            webApiHost.Dispose();
        }
Exemplo n.º 4
0
        private static void Main(string[] args)
        {
            if (args.Length <= 0)
            {
                ShowHelp();
                return;
            }

            if (args[0] == @"\?" || args[0] == @"?" || args[0] == "help")
            {
                ShowHelp();
                return;
            }

            var configuration = GetConfiguration();

            InitializeLogger(configuration);
            WebApiHost = new WebApiHost(configuration);

            if (args[0] == "api")
            {
                ConfigureService(string.Empty);
            }

            if (args[0] == "install" ||
                args[0] == "uninstall")
            {
                ConfigureService(args[0]);
                return;
            }

            ArgsInfo inputArguments = ArgsInfo.Parse(args, false, configuration.Signer.KnownThumbprints);
            var      statusInfo     = MainCore(inputArguments);

            Console.WriteLine(statusInfo.ToJsonString());
        }