You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Radarr/NzbDrone.Api/AppHost.cs

39 lines
1.2 KiB

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();
}
}
}