Sonarr/NzbDrone.Web/Global.asax.cs

51 lines
1.4 KiB
C#
Raw Normal View History

2010-10-15 07:10:44 +00:00
using System;
using System.Diagnostics;
using System.Web;
using System.Web.Mvc;
2010-09-23 03:19:47 +00:00
using System.Web.Routing;
using Ninject;
using Ninject.Web.Mvc;
2010-10-15 07:10:44 +00:00
using NLog;
2010-09-23 03:19:47 +00:00
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-15 07:10:44 +00:00
Instrumentation.Setup();
2010-09-23 03:19:47 +00:00
AreaRegistration.RegisterAllAreas();
RegisterRoutes(RouteTable.Routes);
base.OnApplicationStarted();
2010-09-29 17:19:18 +00:00
}
2010-09-23 03:19:47 +00:00
protected override IKernel CreateKernel()
{
2010-10-10 19:00:07 +00:00
return CentralDispatch.NinjectKernel;
2010-10-15 07:10:44 +00:00
}
2010-10-10 19:00:07 +00:00
2010-10-15 07:10:44 +00:00
// ReSharper disable InconsistentNaming
protected void Application_Error(object sender, EventArgs e)
{
Instrumentation.LogEpicException(Server.GetLastError());
2010-09-23 03:19:47 +00:00
}
2010-10-15 07:10:44 +00:00
2010-09-23 03:19:47 +00:00
}
}