﻿using System;
using Nancy;
using Nancy.Conventions;
using System.IO;

namespace OpenIDConnect.Clients.Angular14.Bootstrap
{
    public class CustomNancyBootstrapper : DefaultNancyBootstrapper
    {
        protected override IRootPathProvider RootPathProvider
        {
            get { return new CustomRootPathProvider(new DefaultRootPathProvider()); }
        }
    }

    internal class CustomRootPathProvider : IRootPathProvider
    {
        private readonly IRootPathProvider provider;

        public CustomRootPathProvider(IRootPathProvider provider)
        {
            this.provider = provider;
        }

        public string GetRootPath()
        {
            var path = Path.Combine(this.provider.GetRootPath(), "content/dist/");
            return path;
        }
    }   
}
﻿using Nancy;
using Nancy.Conventions;
using Nancy.TinyIoc;

namespace OpenIDConnect.Clients.Angular14.Bootstrap
{
    public class CustomNancyBootstrapper : DefaultNancyBootstrapper
    {
        protected override void ApplicationStartup(TinyIoCContainer container, Nancy.Bootstrapper.IPipelines pipelines)
        {
            this.Conventions.ViewLocationConventions.Add((viewName, model, context) =>
            {
                return string.Concat("content/dist/", viewName);
            });
        }

        protected override void ConfigureConventions(NancyConventions conventions)
        {
            base.ConfigureConventions(conventions);

            conventions.StaticContentsConventions.AddDirectory("", "content/dist");
        }
    }    
}
Fix for Nancy view conventions and static content conventions
Fix for Nancy view conventions and static content conventions
