Skip to content

In the host process, it spawns a thread as REST service and listens to the specified port

Notifications You must be signed in to change notification settings

chenghuang-mdsol/Medidata.Cloud.Thermometer

 
 

Repository files navigation

Medidata.Cloud.Thermometer

In the host process, it spawns a thread as REST service and listens to the specified port.

NuGet package

http://nuget.imedidata.net/feed/mdsol/package/nuget/Medidata.Cloud.Thermometer

Install-Package Medidata.Cloud.Thermometer

How to use

using System;
using System.Linq;
using System.Threading;

namespace Medidata.Cloud.Thermometer.Example
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            var app = new LiteRestApp();
            app
                .WhenGet("/actionName", databag =>
                {
                    var msg = String.Join(", ", databag.Select(x => String.Format("[{0}: {1}]", x.Key, x.Value)));
                    return new {result = "OK", message = msg};
                })
                .WhenGet("/anotherAction", databag => new {result = "NG", message = "Exception message"})
                .Listen(9000);

            // Main thread can do other things.
            Console.ReadLine();
            }
        }
    }
}

About

In the host process, it spawns a thread as REST service and listens to the specified port

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PowerShell 72.4%
  • C# 27.0%
  • Batchfile 0.6%