Example #1
0
 public static void AssemblyInit(TestContext context)
 {
     _engine = HandlebarsFactory.CreateEngine();
 }
Example #2
0
        protected void Application_Start()
        {
            // AreaRegistration.RegisterAllAreas();

            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);


            GlobalConfiguration.Configuration.Formatters.Insert(0, new HandlebarsMediaTypeFormatter(GlobalConfiguration.Configuration.Routes,
                                                                                                    HandlebarsFactory.CreateTemplate(),
                                                                                                    new StandardRequestFormatter()));

            GlobalConfiguration.Configuration
            .Formatters
            .JsonFormatter
            .MediaTypeMappings
            .Add(new QueryStringMapping("x-format", "json", new MediaTypeHeaderValue("application/json")));

            // var kernel = new StandardKernel();
            //
            // kernel.Bind<IGridClient>()
            //       .To<GridClusterClient>()
            //       .InSingletonScope();


            // Implement per controller configuration for:
            // [HandlebarsView]
            // -> otherwise we will see actual API controllers returning HTML (which is so so wrong)
            // http://blogs.msdn.com/b/jmstall/archive/2012/05/11/per-controller-configuration-in-webapi.aspx
        }