EchoTex_Payroll/HRM.UI/Controllers/MobileAPI/App_Start/WebApiConfig.cs

29 lines
838 B
C#
Raw Permalink Normal View History

2024-10-14 10:01:49 +06:00
using HRMobileAPI.Components;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http.Headers;
using System.Web.Http;
namespace HRMobileAPI
{
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
// Web API configuration and services
config.Formatters.JsonFormatter.SupportedMediaTypes
.Add(new MediaTypeHeaderValue("text/html"));
config.MessageHandlers.Add(new AuthenticationHandler());
// Web API routes
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
}
}
}