Ejemplo n.º 1
0
        // This code configures Web API. The Startup class is specified as a type
        // parameter in the WebApp.Start method.
        public static void ConfigureApp(IAppBuilder appBuilder, WorkoutConfiguration workoutConfig)
        {
            // Configure Web API for self-host.
            HttpConfiguration config = new HttpConfiguration();

            DependecyProvider.Config(config, workoutConfig);
            MappingConfig.Config();

            config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
                );
            config.EnableCors();
            appBuilder.UseWebApi(config);
        }