Search code examples
asp.net-web-apiowinkatana

How to manage IAppBuilder mapping at runtime?


I'm trying to use Branched Pipeline to defined some sort of virtual directory.

a good example is done here: Run different frameworks side-by-side with OWIN

public class Startup
{
    public void Configuration(IAppBuilder app)
    {
        app.UseWebApi(new MyHttpConfiguration());
        app.Map("/newSite", site =>
        {
            site.MapSignalR();
            site.UseNancy();
        });
    }
}

Here I can have a virtual directory newSite with a custom HttpConfiguration.

This configuration is done in the Startup class and it works. But I would like to be able to add/change the IAppBuilder at runtime during the lifetime of the App. Indeed I'm using the SelfHost Server and I would like to create new virtual directory (or subsite or anything else) using a admin console to create a pluggable architecture with differents component (api/authorization handler etc...) with configuration at runtime.

Is it possible?

I don't know where I can apply a new configuration during runtime

Thanks a lot

Best Regards.


Solution

  • It is not possible to adjust the OWIN configuration after it has been set.

    The only alternative is to simply restart your server, making the Configuration method run again.