mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 05:13:18 -07:00
Renamed folders
This commit is contained in:
parent
4ce66195d4
commit
d1827cd3be
117 changed files with 16 additions and 16 deletions
85
PlexRequests.UI/Bootstrapper.cs
Normal file
85
PlexRequests.UI/Bootstrapper.cs
Normal file
|
@ -0,0 +1,85 @@
|
|||
#region Copyright
|
||||
// /************************************************************************
|
||||
// Copyright (c) 2016 Jamie Rees
|
||||
// File: Bootstrapper.cs
|
||||
// Created By: Jamie Rees
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
// ************************************************************************/
|
||||
#endregion
|
||||
using Mono.Data.Sqlite;
|
||||
|
||||
using Nancy;
|
||||
using Nancy.Authentication.Forms;
|
||||
using Nancy.Bootstrapper;
|
||||
using Nancy.Diagnostics;
|
||||
using Nancy.Session;
|
||||
using Nancy.TinyIoc;
|
||||
|
||||
using PlexRequests.Core;
|
||||
using PlexRequests.Core.SettingModels;
|
||||
using PlexRequests.Helpers;
|
||||
using PlexRequests.Store;
|
||||
using PlexRequests.Store.Repository;
|
||||
|
||||
namespace PlexRequests.UI
|
||||
{
|
||||
public class Bootstrapper : DefaultNancyBootstrapper
|
||||
{
|
||||
// The bootstrapper enables you to reconfigure the composition of the framework,
|
||||
// by overriding the various methods and properties.
|
||||
// For more information https://github.com/NancyFx/Nancy/wiki/Bootstrapper
|
||||
|
||||
protected override void ConfigureRequestContainer(TinyIoCContainer container, NancyContext context)
|
||||
{
|
||||
container.Register<IUserMapper, UserMapper>();
|
||||
|
||||
container.Register<ISqliteConfiguration, DbConfiguration>(new DbConfiguration(new SqliteFactory()));
|
||||
|
||||
container.Register<ISettingsRepository, JsonRepository>();
|
||||
container.Register<ICacheProvider, MemoryCacheProvider>();
|
||||
|
||||
container.Register<ISettingsService<RequestPlexSettings>, SettingsServiceV2<RequestPlexSettings>>();
|
||||
container.Register<ISettingsService<CouchPotatoSettings>, SettingsServiceV2<CouchPotatoSettings>>();
|
||||
container.Register<IRepository<RequestedModel>, GenericRepository<RequestedModel>>();
|
||||
|
||||
base.ConfigureRequestContainer(container, context);
|
||||
}
|
||||
|
||||
protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines)
|
||||
{
|
||||
CookieBasedSessions.Enable(pipelines);
|
||||
StaticConfiguration.DisableErrorTraces = false;
|
||||
|
||||
base.ApplicationStartup(container, pipelines);
|
||||
|
||||
// Enable forms auth
|
||||
var formsAuthConfiguration = new FormsAuthenticationConfiguration
|
||||
{
|
||||
RedirectUrl = "~/login",
|
||||
UserMapper = container.Resolve<IUserMapper>()
|
||||
};
|
||||
|
||||
FormsAuthentication.Enable(pipelines, formsAuthConfiguration);
|
||||
}
|
||||
|
||||
protected override DiagnosticsConfiguration DiagnosticsConfiguration => new DiagnosticsConfiguration { Password = @"password" };
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue