using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Web;
using Funq;
using NetworkedShapeCreator.ServiceInterface;
using ServiceStack;
using ServiceStack.Configuration;
using ServiceStack.Razor;
namespace NetworkedShapeCreator
{
public class AppHost : AppHostBase
{
///
/// Default constructor.
/// Base constructor requires a name and assembly to locate web service classes.
///
public AppHost()
: base("NetworkedShapeCreator", typeof(MyServices).Assembly)
{
var customSettings = new FileInfo(@"~/appsettings.txt".MapHostAbsolutePath());
AppSettings = customSettings.Exists
? (IAppSettings)new TextFileSettings(customSettings.FullName)
: new AppSettings();
}
///
/// Application specific configuration
/// This method should initialize any IoC resources utilized by your web service classes.
///
///
public override void Configure(Container container)
{
//Config examples
//this.Plugins.Add(new PostmanFeature());
//this.Plugins.Add(new CorsFeature());
SetConfig(new HostConfig
{
DebugMode = AppSettings.Get("DebugMode", false),
AddRedirectParamsToQueryString = true
});
this.Plugins.Add(new RazorFormat());
Plugins.Add(new ServerEventsFeature());
}
}
}