<commit_before>﻿using System;
using System.Security.Claims;
using System.Security.Principal;
using EasyNetQ;
using FP.Spartakiade2017.PicFlow.Contracts;
using FP.Spartakiade2017.PicFlow.Contracts.FileHandler;
using FP.Spartakiade2017.PicFlow.WebApp.Modules;
using Nancy;
using Nancy.Authentication.Stateless;
using Nancy.Bootstrapper;
using Nancy.Conventions;
using Nancy.TinyIoc;

namespace FP.Spartakiade2017.PicFlow.WebApp
{
    public class Bootstrapper : DefaultNancyBootstrapper
    {
        protected override void ConfigureConventions(NancyConventions nancyConventions)
        {
            base.ConfigureConventions(nancyConventions);

            nancyConventions.StaticContentsConventions.Add(StaticContentConventionBuilder.AddDirectory("css", "css"));
            nancyConventions.StaticContentsConventions.Add(StaticContentConventionBuilder.AddDirectory("img", "img"));
            nancyConventions.StaticContentsConventions.Add(StaticContentConventionBuilder.AddDirectory("font", "font"));
            nancyConventions.StaticContentsConventions.Add(StaticContentConventionBuilder.AddDirectory("js", "js"));
        }

        protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines)
        {
            var bus = RabbitHutch.CreateBus(EnvironmentVariable.GetValueOrDefault("ConnectionStringRabbitMQ", "host=localhost"));
            container.Register<IBus>(bus);
            container.Register(new ImageRepository(EnvironmentVariable.GetValueOrDefault("ConnectionStringImageDB", 
                "host=localhost;database=devspace;password=<PASSWORD>;username=devspace")));
            var authenticationRepository = new AuthenticationRepository(bus);
            container.Register<AuthenticationRepository>(authenticationRepository);
            container.Register<IFileHandler, MongoDbFileHandler>(new MongoDbFileHandler(EnvironmentVariable.GetValueOrDefault("ConnectionStringDocumentDB", "mongodb://localhost")));
<commit_msg>Pic-flow: update login<commit_after>﻿using System;
using System.Security.Claims;
using System.Security.Principal;
using EasyNetQ;
using FP.Spartakiade2017.PicFlow.Contracts;
using FP.Spartakiade2017.PicFlow.Contracts.FileHandler;
using FP.Spartakiade2017.PicFlow.WebApp.Modules;
using Nancy;
using Nancy.Authentication.Stateless;
using Nancy.Bootstrapper;
using Nancy.Conventions;
using Nancy.TinyIoc;

namespace FP.Spartakiade2017.PicFlow.WebApp
{
    public class Bootstrapper : DefaultNancyBootstrapper
    {
        protected override void ConfigureConventions(NancyConventions nancyConventions)
        {
            base.ConfigureConventions(nancyConventions);

            nancyConventions.StaticContentsConventions.Add(StaticContentConventionBuilder.AddDirectory("css", "css"));
            nancyConventions.StaticContentsConventions.Add(StaticContentConventionBuilder.AddDirectory("img", "img"));
            nancyConventions.StaticContentsConventions.Add(StaticContentConventionBuilder.AddDirectory("font", "font"));
            nancyConventions.StaticContentsConventions.Add(StaticContentConventionBuilder.AddDirectory("js", "js"));
        }

        protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines)
        {
            var bus = RabbitHutch.CreateBus(EnvironmentVariable.GetValueOrDefault("ConnectionStringRabbitMQ", "host=localhost"));
            container.Register<IBus>(bus);
            container.Register(new ImageRepository(EnvironmentVariable.GetValueOrDefault("ConnectionStringImageDB",
                "host=localhost;database=spartakiade;password=<PASSWORD>;username=spartakiade")));
            var authenticationRepository = new AuthenticationRepository(bus);
            container.Register<AuthenticationRepository>(authenticationRepository);
            container.Register<IFileHandler, MongoDbFileHandler>(new MongoDbFileHandler(EnvironmentVariable.GetValueOrDefault("ConnectionStringDocumentDB", "mongodb://localhost")));

{'fraction_non_alphanumeric': 0.09040683073832245, 'fraction_numerical': 0.00803616273229533, 'mean_word_length': 5.156105100463678, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2261164', 'n_tokens_mistral': 1054, 'n_tokens_neox': 997, 'n_words': 138}