2012-11-02 10:35:49 +03:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Reflection;
|
|
|
|
using System.Web;
|
|
|
|
using Funq;
|
2012-11-03 21:23:47 +03:00
|
|
|
using Ninject;
|
|
|
|
using NzbDrone.Api.QualityProfiles;
|
|
|
|
using ServiceStack.ContainerAdapter.Ninject;
|
2012-11-02 10:35:49 +03:00
|
|
|
using ServiceStack.WebHost.Endpoints;
|
|
|
|
|
2012-11-03 21:23:47 +03:00
|
|
|
namespace NzbDrone.Api
|
2012-11-02 10:35:49 +03:00
|
|
|
{
|
|
|
|
public class AppHost : AppHostBase
|
|
|
|
{
|
2012-11-03 21:23:47 +03:00
|
|
|
private IKernel _kernel;
|
|
|
|
|
|
|
|
public AppHost(IKernel kernel) //Tell ServiceStack the name and where to find your web services
|
|
|
|
: base("NzbDrone API", typeof(QualityProfileService).Assembly)
|
|
|
|
{
|
|
|
|
_kernel = kernel;
|
|
|
|
}
|
2012-11-02 10:35:49 +03:00
|
|
|
|
|
|
|
public override void Configure(Container container)
|
|
|
|
{
|
2012-11-03 21:23:47 +03:00
|
|
|
container.Adapter = new NinjectContainerAdapter(_kernel);
|
2012-11-02 10:35:49 +03:00
|
|
|
SetConfig(new EndpointHostConfig { ServiceStackHandlerFactoryPath = "api" });
|
|
|
|
|
|
|
|
Routes
|
2012-11-04 04:39:29 +03:00
|
|
|
.Add<QualityProfileModel>("/qualityprofiles")
|
|
|
|
.Add<QualityProfileModel>("/qualityprofiles/{Id}");
|
|
|
|
|
|
|
|
Bootstrapper.Initialize();
|
2012-11-02 10:35:49 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|