29 lines
838 B
C#
29 lines
838 B
C#
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 }
|
|
);
|
|
}
|
|
}
|
|
}
|