1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/NzbDrone.Api/AppHost.cs
2013-01-02 17:09:13 -08:00

39 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Web;
using Autofac;
using Funq;
using NzbDrone.Api.QualityProfiles;
using NzbDrone.Api.QualityType;
using ServiceStack.WebHost.Endpoints;
using QualityProfileService = NzbDrone.Api.QualityProfiles.QualityProfileService;
namespace NzbDrone.Api
{
public class AppHost : AppHostBase
{
private IContainer _container;
public AppHost(IContainer container) //Tell ServiceStack the name and where to find your web services
: base("NzbDrone API", typeof(QualityProfileService).Assembly)
{
_container = container;
}
public override void Configure(Container container)
{
container.Adapter = new AutofacIocAdapter(_container);
SetConfig(new EndpointHostConfig { ServiceStackHandlerFactoryPath = "api" });
Routes
.Add<QualityProfileModel>("/qualityprofiles")
.Add<QualityProfileModel>("/qualityprofiles/{Id}")
.Add<QualityTypeModel>("/qualitytypes")
.Add<QualityTypeModel>("/qualitytypes/{Id}");
Bootstrapper.Initialize();
}
}
}