WIP
parent
32e4ace694
commit
4390953eb2
23
Program.cs
23
Program.cs
|
@ -8,13 +8,36 @@ using ln.manage;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using ln.types.threads;
|
using ln.types.threads;
|
||||||
using ln.types.net;
|
using ln.types.net;
|
||||||
|
using ln.http;
|
||||||
|
|
||||||
namespace ln.provider
|
namespace ln.provider
|
||||||
{
|
{
|
||||||
class MainClass
|
class MainClass
|
||||||
{
|
{
|
||||||
|
public static HttpResponse LogRequest(HttpRequest request)
|
||||||
|
{
|
||||||
|
Logging.Log(LogLevel.INFO, "Request: {0}",request);
|
||||||
|
foreach (String pName in request.ParameterNames)
|
||||||
|
{
|
||||||
|
Logging.Log(LogLevel.INFO, "Request Parameter: {0} = {1}", pName, request.GetParameter(pName));
|
||||||
|
}
|
||||||
|
|
||||||
|
return new HttpResponse(request);
|
||||||
|
}
|
||||||
|
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
|
SimpleHttpRouter restRouter = new SimpleHttpRouter();
|
||||||
|
restRouter.AddSimpleRoute("/:arg1/:arg2", new RouterTarget(LogRequest));
|
||||||
|
|
||||||
|
SimpleHttpRouter simpleHttpRouter = new SimpleHttpRouter();
|
||||||
|
simpleHttpRouter.AddSimpleRoute("/*", new RouterTarget(LogRequest));
|
||||||
|
simpleHttpRouter.AddSimpleRoute("/api/v1/*", restRouter);
|
||||||
|
|
||||||
|
|
||||||
|
HTTPServer hTTPServer = new HTTPServer(new Endpoint(IPv6.ANY,8888),simpleHttpRouter);
|
||||||
|
hTTPServer.Start();
|
||||||
|
|
||||||
//new ProviderApplication().Start(args);
|
//new ProviderApplication().Start(args);
|
||||||
|
|
||||||
ManagedRoot managedRoot = new ManagedRoot();
|
ManagedRoot managedRoot = new ManagedRoot();
|
||||||
|
|
Loading…
Reference in New Issue