Skip to content

Instantly share code, notes, and snippets.

@nathanwoulfe
Created February 4, 2019 09:29
Show Gist options
  • Save nathanwoulfe/ea162882137b30484a5e83ed91ff16bc to your computer and use it in GitHub Desktop.
Save nathanwoulfe/ea162882137b30484a5e83ed91ff16bc to your computer and use it in GitHub Desktop.
MapHttpAttributeRoutes
// 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