Custom Nancy bootstrapper not being called

Dan D.

I am building a Nancy based application which uses the NancyHost as the embedded web server.

I am also trying to serve some static content, by creating a custom bootstrapper as described in their documentation here. However, the problem I see is that this custom bootstrapper class is never instantiated and the ConfigureConventions method is never called. Is there any specific action that I have to do in order to make sure this custom bootstrapper is registered?

The custom bootstrapper code below:

using Nancy;
using Nancy.Conventions;
using System;

namespace Application
{
    public class CustomBootstrapper : DefaultNancyBootstrapper
    {
        protected override void ConfigureConventions(NancyConventions conventions)
        {
            Console.WriteLine("test");
            conventions.StaticContentsConventions.Add(StaticContentConventionBuilder.AddDirectory("client", @"client"));
            conventions.StaticContentsConventions.Add(StaticContentConventionBuilder.AddDirectory("lib", @"lib"));
            base.ConfigureConventions(conventions);
        }
    }
}
Dan D.

It turns out that I had to pass the reference to my CustomBootstrapper in the NancyHost constructor.

var host = new NancyHost(new Uri(JsonHelper.URL), new CustomBootstrapper(), config);
host.Start();

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

DryIoc - Nancy Bootstrapper?

From Dev

Field not found: 'Nancy.Bootstrapper.NancyBootstrapperLocator.Bootstrapper'

From Dev

How to override GetRootPath for Nancy bootstrapper?

From Dev

Custom Authentication Provider Not Being Called

From Dev

Custom ArrayAdapter getFilter() not being called

From Dev

Angular custom directive not being called

From Dev

python logging dictConfig custom formatter is not being called

From Dev

AngularJS: $resource custom methods not being called

From Dev

cellForRowAtIndexPath is not being called from custom class

From Dev

MVVMCross iOS custom visibility converter not being called

From Dev

Custom js functions not being called in webpack

From Dev

Caliburn Micro App Bootstrapper is not called

From Dev

Custom Nancy viewEngine

From Dev

The type initializer for 'Nancy.Bootstrapper.AppDomainAssemblyTypeScanner' threw an exception

From Dev

Custom Logging Interface for PRISM Bootstrapper

From Dev

Testing code in a custom NancyFx Bootstrapper

From Dev

Delegate didSet property of UIView not being called inside custom UITableViewCell

From Dev

Overriding custom cell initWithStyle method but it's not being called

From Dev

Android custom view not repainting, though onDraw is being called

From Dev

ASP.NET Identity - Custom role validation not being called

From Dev

Knockout binding value.update not being called with custom binding and defineProperty

From Dev

iphone - didSelectRowAtIndexPath: only being called after long press on custom cell

From Dev

JavaFX custom list cell, updateItem being called a lot

From Dev

Devise custom after_update_path_for not being called(Rails 4)

From Dev

Custom UIView Subclass's drawRect not being called inside UITableViewCell

From Dev

JSR303 custom validators being called twice

From Dev

Django custom auth backend doesn't seem to be being called?

From Dev

Cocoa: initWithFrame from a custom view proxy is not being called

From Dev

Custom Equals function not being called when using IEqualityComparer

Related Related

  1. 1

    DryIoc - Nancy Bootstrapper?

  2. 2

    Field not found: 'Nancy.Bootstrapper.NancyBootstrapperLocator.Bootstrapper'

  3. 3

    How to override GetRootPath for Nancy bootstrapper?

  4. 4

    Custom Authentication Provider Not Being Called

  5. 5

    Custom ArrayAdapter getFilter() not being called

  6. 6

    Angular custom directive not being called

  7. 7

    python logging dictConfig custom formatter is not being called

  8. 8

    AngularJS: $resource custom methods not being called

  9. 9

    cellForRowAtIndexPath is not being called from custom class

  10. 10

    MVVMCross iOS custom visibility converter not being called

  11. 11

    Custom js functions not being called in webpack

  12. 12

    Caliburn Micro App Bootstrapper is not called

  13. 13

    Custom Nancy viewEngine

  14. 14

    The type initializer for 'Nancy.Bootstrapper.AppDomainAssemblyTypeScanner' threw an exception

  15. 15

    Custom Logging Interface for PRISM Bootstrapper

  16. 16

    Testing code in a custom NancyFx Bootstrapper

  17. 17

    Delegate didSet property of UIView not being called inside custom UITableViewCell

  18. 18

    Overriding custom cell initWithStyle method but it's not being called

  19. 19

    Android custom view not repainting, though onDraw is being called

  20. 20

    ASP.NET Identity - Custom role validation not being called

  21. 21

    Knockout binding value.update not being called with custom binding and defineProperty

  22. 22

    iphone - didSelectRowAtIndexPath: only being called after long press on custom cell

  23. 23

    JavaFX custom list cell, updateItem being called a lot

  24. 24

    Devise custom after_update_path_for not being called(Rails 4)

  25. 25

    Custom UIView Subclass's drawRect not being called inside UITableViewCell

  26. 26

    JSR303 custom validators being called twice

  27. 27

    Django custom auth backend doesn't seem to be being called?

  28. 28

    Cocoa: initWithFrame from a custom view proxy is not being called

  29. 29

    Custom Equals function not being called when using IEqualityComparer

HotTag

Archive