45 lines
1.2 KiB
C#
45 lines
1.2 KiB
C#
using System;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using cloud.insecurity.http;
|
|
using log4net;
|
|
|
|
namespace cloud.insecurity.docker.ipam
|
|
{
|
|
internal class Ipam
|
|
{
|
|
private static log4net.ILog Log
|
|
{
|
|
get
|
|
{
|
|
return log4net.LogManager.GetLogger(typeof(Ipam));
|
|
}
|
|
}
|
|
internal static void Main(string[] args)
|
|
{
|
|
log4net.Config.XmlConfigurator.Configure();
|
|
Task server = HttpServer.Server.Start(new string[]
|
|
{
|
|
"http://127.0.0.1:8000/",
|
|
});
|
|
|
|
Scope.GetParentScopes().ToList().ForEach(f => Console.WriteLine(
|
|
string.Format("{0}", f.ToString())));
|
|
|
|
Console.CancelKeyPress += (sender, eventArgs) =>
|
|
{
|
|
Console.WriteLine("shutting down");
|
|
HttpServer.Server.Stop();
|
|
server.Wait();
|
|
Environment.Exit(0);
|
|
};
|
|
|
|
ReadKey:
|
|
switch (Console.ReadKey().Key)
|
|
{
|
|
default:
|
|
goto ReadKey;
|
|
}
|
|
}
|
|
}
|
|
} |