/// <summary> /// /// </summary> /// <param name="app"></param> public void Configuration(IAppBuilder app) { HttpConfiguration config = new HttpConfiguration(); RouteConfig.Configure(config); FormatterConfig.Configure(config); SwaggerConfig.Configure(config); app.UseWebApi(config); }
/// <summary> /// Specifies how the ASP.NET application will respond to individual HTTP request. /// </summary> /// <param name="app">Instance of <see cref="IAppBuilder"/>.</param> public void Configuration(IAppBuilder app) { var corsOptions = CorsConfig.ConfigureCors(ConfigurationManager.AppSettings["cors"]); app.UseCors(corsOptions); var configuration = new HttpConfiguration(); FormatterConfig.Configure(configuration); RouteConfig.Configure(configuration); ServiceConfig.Configure(configuration); app.UseWebApi(configuration); }
public static HttpConfiguration Build(Container container) { var configuration = new HttpConfiguration(); FormatterConfig.Configure(configuration); SwaggerConfig.Configure(configuration); container.RegisterWebApiControllers(configuration, Assembly.GetExecutingAssembly(), typeof(IpAdressesController).Assembly); container.EnableHttpRequestMessageTracking(configuration); configuration.DependencyResolver = new SimpleInjectorWebApiDependencyResolver(container); configuration.MapHttpAttributeRoutes(); container.Verify(); return(configuration); }
/// <summary> /// Specifies how the ASP.NET application will respond to individual HTTP request. /// </summary> /// <param name="app">Instance of <see cref="IAppBuilder"/>.</param> public void Configuration(IAppBuilder app) { CorsConfig.ConfigureCors(ConfigurationManager.AppSettings["cors"]); app.UseCors(CorsConfig.Options); var configuration = new HttpConfiguration(); AutofacConfig.Configure(configuration); app.UseAutofacMiddleware(AutofacConfig.Container); FormatterConfig.Configure(configuration); RouteConfig.Configure(configuration); ServiceConfig.Configure(configuration); app.UseWebApi(configuration); }
protected void Application_Start(object sender, EventArgs e) { GlobalConfiguration.Configure(config => { RouterConfig.Configure(config); /* GlobalConfiguration.Configure(configuration => * { * configuration.Routes.MapHttpRoute( * name: "DefaulApi", * routeTemplate: "api/{controller}/{id}", * defaults: new { id = RouteParameter.Optional }); * * }); */ FormatterConfig.Configure(config); }); }
/// <summary> /// Specifies how the ASP.NET application will respond to individual HTTP request. /// </summary> /// <param name="app">Instance of <see cref="IAppBuilder"/>.</param> public void Configuration(IAppBuilder app) { LogConfig.Configure(); app.UseRequestLogging(); CorsConfig.ConfigureCors(ConfigurationManager.AppSettings["cors"]); app.UseCors(CorsConfig.Options); HttpConfiguration configuration = new HttpConfiguration(); FormatterConfig.Configure(configuration); RouteConfig.Configure(configuration); ServiceConfig.Configure(configuration); SwaggerConfig.Configure(configuration); app.UseWebApi(configuration); MappingProfile map = new MappingProfile(); map.Iniciar(); }
/// <summary> /// Specifies how the ASP.NET application will respond to individual HTTP request. /// </summary> /// <param name="app">Instance of <see cref="IAppBuilder"/>.</param> public void Configuration(IAppBuilder app) { CorsConfig.ConfigureCors(ConfigurationManager.AppSettings["cors"]); app.UseCors(CorsConfig.Options); var configuration = new HttpConfiguration(); AutofacConfig.Configure(configuration); app.UseAutofacMiddleware(AutofacConfig.Container); FormatterConfig.Configure(configuration); RouteConfig.Configure(configuration); ServiceConfig.Configure(configuration); SwaggerConfig.Configure(configuration); app.Use((context, next) => { context.Response.Headers.Remove("Server"); return(next.Invoke()); }); app.UseWebApi(configuration); }