RegisterServiceRoutes() public static method

public static RegisterServiceRoutes ( RouteCollection routes ) : void
routes RouteCollection
return void
Ejemplo n.º 1
0
        private static void AppPostStart()
        {
            Routes.RegisterRoutes(RouteTable.Routes);
            Routes.RegisterServiceRoutes(RouteTable.Routes);
            AreaRegistration.RegisterAllAreas();

            GlobalFilters.Filters.Add(new ElmahHandleErrorAttribute());
            GlobalFilters.Filters.Add(new ReadOnlyModeErrorFilter());
            GlobalFilters.Filters.Add(new AntiForgeryErrorFilter());
            ValueProviderFactories.Factories.Add(new HttpHeaderValueProviderFactory());
        }
Ejemplo n.º 2
0
        private static void AppPostStart(IAppConfiguration configuration)
        {
            Routes.RegisterRoutes(RouteTable.Routes, configuration.FeedOnlyMode);
            Routes.RegisterServiceRoutes(RouteTable.Routes);
            AreaRegistration.RegisterAllAreas();

            GlobalFilters.Filters.Add(new SendErrorsToTelemetryAttribute {
                View = "~/Views/Errors/InternalError.cshtml"
            });
            GlobalFilters.Filters.Add(new ReadOnlyModeErrorFilter());
            GlobalFilters.Filters.Add(new AntiForgeryErrorFilter());
            ValueProviderFactories.Factories.Add(new HttpHeaderValueProviderFactory());
        }
Ejemplo n.º 3
0
        private static void AppPostStart()
        {
            Routes.RegisterRoutes(RouteTable.Routes);
            Routes.RegisterServiceRoutes(RouteTable.Routes);
            AreaRegistration.RegisterAllAreas();

            GlobalFilters.Filters.Add(new ElmahHandleErrorAttribute());
            GlobalFilters.Filters.Add(new ReadOnlyModeErrorFilter());
            GlobalFilters.Filters.Add(new RequireRemoteHttpsAttribute()
            {
                OnlyWhenAuthenticated = true
            });
            ValueProviderFactories.Factories.Add(new HttpHeaderValueProviderFactory());
        }
Ejemplo n.º 4
0
        private static void AppPostStart(IAppConfiguration configuration)
        {
            Routes.RegisterRoutes(RouteTable.Routes);
            Routes.RegisterServiceRoutes(RouteTable.Routes);
            AreaRegistration.RegisterAllAreas();


            GlobalFilters.Filters.Add(new ElmahHandleErrorAttribute());
            GlobalFilters.Filters.Add(new ReadOnlyModeErrorFilter());
            GlobalFilters.Filters.Add(new AntiForgeryErrorFilter());
            var googleAnalyticsId = configuration.GoogleAnalyticsPropertyId;

            if (googleAnalyticsId != null)
            {
                var tracker = new Tracker(googleAnalyticsId, configuration.SiteRoot, new CookieBasedAnalyticsSession());
                GlobalFilters.Filters.Add(new GoogleAnalyticsTracker.Web.Mvc.ActionTrackingAttribute(tracker, descriptor =>
                {
                    var controllerType = descriptor.ControllerDescriptor.ControllerType;
                    return(typeof(ApiController).IsAssignableFrom(controllerType) || typeof(JsonController).IsAssignableFrom(controllerType));
                }));
            }
            ValueProviderFactories.Factories.Add(new HttpHeaderValueProviderFactory());
        }