51 lines
1.4 KiB
C#
51 lines
1.4 KiB
C#
// /**
|
|
// * File: ApplicationDemo.cs
|
|
// * Author: haraldwolff
|
|
// *
|
|
// * This file and it's content is copyrighted by the Author and / or copyright holder.
|
|
// * Any use wihtout proper permission is illegal and may lead to legal actions.
|
|
// *
|
|
// *
|
|
// **/
|
|
using System;
|
|
using ln.http.resources;
|
|
using ln.application.service;
|
|
using ln.http;
|
|
using ln.http.listener;
|
|
namespace ln.application.demo
|
|
{
|
|
public class ApplicationDemo : Application
|
|
{
|
|
public override void PrepareStart()
|
|
{
|
|
base.PrepareStart();
|
|
|
|
ServiceContainer.Add(ServiceDefinition.From<ApplicationService>(true));
|
|
}
|
|
|
|
class ApplicationService : ApplicationServiceBase
|
|
{
|
|
|
|
public ApplicationService() : base("core") { }
|
|
|
|
|
|
public override void ServiceMain(IApplicationInterface applicationInterface)
|
|
{
|
|
DirectoryResource directoryResource = new DirectoryResource(new string[] { "../../www", "www" });
|
|
directoryResource.DefaultResource = directoryResource.GetResource("demo.html");
|
|
directoryResource.FallBackResource = directoryResource.DefaultResource;
|
|
|
|
CurrentApplicationInterface.HTTPApplication.RootResource = directoryResource;
|
|
|
|
//applicationInterface.HttpServer.AddListener(new HttpsListener(8443));
|
|
|
|
base.ServiceMain(applicationInterface);
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
}
|