mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.8 KiB
49 lines
1.8 KiB
// ==========================================================================
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex UG (haftungsbeschränkt)
|
|
// All rights reserved. Licensed under the MIT license.
|
|
// ==========================================================================
|
|
|
|
using System.IO;
|
|
using Microsoft.AspNetCore.Hosting;
|
|
using Microsoft.Extensions.Configuration;
|
|
using Microsoft.Extensions.Logging;
|
|
using Squidex.Config;
|
|
using Squidex.Infrastructure.Log.Adapter;
|
|
|
|
namespace Squidex
|
|
{
|
|
public static class Program
|
|
{
|
|
public static void Main(string[] args)
|
|
{
|
|
BuildWebHost(args).Run();
|
|
}
|
|
|
|
public static IWebHost BuildWebHost(string[] args) =>
|
|
new WebHostBuilder()
|
|
.UseKestrel(k => { k.AddServerHeader = false; })
|
|
.UseContentRoot(Directory.GetCurrentDirectory())
|
|
.UseIIS()
|
|
.UseStartup<WebStartup>()
|
|
.ConfigureLogging((hostingContext, builder) =>
|
|
{
|
|
builder.AddConfiguration(hostingContext.Configuration.GetSection("logging"));
|
|
builder.AddSemanticLog();
|
|
builder.AddFilters();
|
|
})
|
|
.ConfigureAppConfiguration((hostContext, builder) =>
|
|
{
|
|
builder.Sources.Clear();
|
|
|
|
builder.AddJsonFile($"appsettings.json", true, true);
|
|
builder.AddJsonFile($"appsettings.{hostContext.HostingEnvironment.EnvironmentName}.json", true);
|
|
|
|
builder.AddEnvironmentVariables();
|
|
|
|
builder.AddCommandLine(args);
|
|
})
|
|
.Build();
|
|
}
|
|
}
|
|
|