Beispiel #1
0
        public void Start()
        {
            // start a thread and start doing some processing
            Console.WriteLine("Thread started, processing..");

            using (var app = new WebApiApplication())
            {
                Console.WriteLine("Work path: " + Config.Pathes.Work);
                Console.WriteLine("Writing in work path: " + (Config.Pathes.WriteAllow ? "allowed" : "DENIED"));
                Console.WriteLine("Admin rights: " + (Config.AdminRights ? "yes" : "no"));

                Console.WriteLine("Init server... Base address: " + app.Address);
                app.Run();
                // Create HttpCient and make a request to api/values
                //HttpClient client = new HttpClient();

                //var response = client.GetAsync(baseAddress + "api/values").Result;

                //Console.WriteLine(response);
                //Console.WriteLine(response.Content.ReadAsStringAsync().Result);
                Console.WriteLine("Listening...");
                while (!exitSystem)
                {
                }
            }
        }
Beispiel #2
0
 protected override void OnStart(string[] args)
 {
     try
     {
         app = new WebApiApplication();
         app.Run();
     }
     catch (Exception ex) { Catch.Set(ex); }
     base.OnStart(args);
 }