elsa-core/src/server/Elsa.Server.Api/Extensions/ServiceCollectionExtensions.cs

25 lines
809 B
C#
Raw Normal View History

2020-10-19 20:12:11 +00:00
using Elsa.Server.Api.Extensions;
using Microsoft.AspNetCore.Mvc;
// ReSharper disable once CheckNamespace
namespace Microsoft.Extensions.DependencyInjection
{
public static class ServiceCollectionExtensions
{
public static IServiceCollection AddElsaApiEndpoints(this IServiceCollection services)
{
services.AddControllers().AddJsonSerialization();
2020-10-19 20:12:11 +00:00
services.AddRouting(options => options.LowercaseUrls = true);
services.AddApiVersioning(
options =>
{
options.ReportApiVersions = true;
options.DefaultApiVersion = ApiVersion.Default;
options.AssumeDefaultVersionWhenUnspecified = true;
});
return services;
}
}
}