Headless CMS and Content Managment Hub
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.
 
 
 
 
 

55 lines
1.7 KiB

// ==========================================================================
// Startup.cs
// PinkParrot Headless CMS
// ==========================================================================
// Copyright (c) PinkParrot Group
// All rights reserved.
// ==========================================================================
using System;
using Autofac;
using Autofac.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using PinkParrot.Configurations;
// ReSharper disable AccessToModifiedClosure
namespace PinkParrot
{
public class Startup
{
public IServiceProvider ConfigureServices(IServiceCollection services)
{
services.AddMvc().AddAppSerializers();
services.AddRouting();
services.AddMemoryCache();
services.AddEventFormatter();
var builder = new ContainerBuilder();
builder.RegisterModule<InfrastructureModule>();
builder.RegisterModule<ReadModule>();
builder.RegisterModule<WriteModule>();
builder.Populate(services);
return new AutofacServiceProvider(builder.Build());
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
loggerFactory.AddConsole();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseAppTenants();
app.UseMvc();
app.UseStaticFiles();
app.UseAppEventBus();
}
}
}