Created
February 4, 2019 09:29
-
-
Save nathanwoulfe/ea162882137b30484a5e83ed91ff16bc to your computer and use it in GitHub Desktop.
MapHttpAttributeRoutes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// v7 version | |
using System.Web.Http; | |
using Umbraco.Core; | |
namespace MyNamespace | |
{ | |
public static class WebApiConfig | |
{ | |
public static void Register(HttpConfiguration config) | |
{ | |
// other things, then: | |
config.MapHttpAttributeRoutes(); | |
} | |
} | |
public class StartupStuff : ApplicationEventHandler | |
{ | |
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) | |
{ | |
// other things, then: | |
GlobalConfiguration.Configure(WebApiConfig.Register); | |
} | |
} | |
} | |
// where would I run the same in v8? | |
// tried in both component and composer, but got boot errors for both. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment