2010-09-22 20:19:47 -07:00
|
|
|
using System.Web.Mvc;
|
|
|
|
using System.Web.Routing;
|
|
|
|
using Ninject;
|
|
|
|
using Ninject.Web.Mvc;
|
|
|
|
using NzbDrone.Core;
|
|
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Web
|
|
|
|
{
|
|
|
|
public class MvcApplication : NinjectHttpApplication
|
|
|
|
{
|
|
|
|
|
|
|
|
public static void RegisterRoutes(RouteCollection routes)
|
|
|
|
{
|
|
|
|
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
|
|
|
|
routes.IgnoreRoute("{*robotstxt}", new { robotstxt = @"(.*/)?robots.txt(/.*)?" });
|
|
|
|
routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
|
|
|
|
|
|
|
|
routes.MapRoute(
|
|
|
|
"Default", // Route name
|
|
|
|
"{controller}/{action}/{id}", // URL with parameters
|
|
|
|
new { controller = "Series", action = "Index", id = UrlParameter.Optional } // Parameter defaults
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override void OnApplicationStarted()
|
|
|
|
{
|
2010-10-04 23:21:18 -07:00
|
|
|
CentralDispatch.ConfigureNlog();
|
2010-09-22 20:19:47 -07:00
|
|
|
AreaRegistration.RegisterAllAreas();
|
|
|
|
RegisterRoutes(RouteTable.Routes);
|
|
|
|
base.OnApplicationStarted();
|
2010-09-29 10:19:18 -07:00
|
|
|
}
|
2010-09-22 20:19:47 -07:00
|
|
|
|
|
|
|
protected override IKernel CreateKernel()
|
|
|
|
{
|
2010-10-10 12:00:07 -07:00
|
|
|
return CentralDispatch.NinjectKernel;
|
|
|
|
|
2010-09-22 20:19:47 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|