How to "nest" an MVC Core application into an existing MVC Core site

I am looking at creating a "dashboard" that is used when developing / debugging an ASPNET MVC Core site. The tricky part is that I would like my own panel to be an MVC Core site, and I don't want it to interfere with the "parent" site.

Ideally, the wiring would be as simple as:

app.UseMyDashboard("/somepath");

      

Then it will be shown on my way. Make it your own maintenance container to avoid polluting the parent site with any of the services required to run the toolbar app.

If that's all possible, I would like it to be completely self-contained.

+3


source to share


2 answers


It's not usually about how you do it. A common case in modular / microservice applications is to create separate applications that run on their own port and use a reverse proxy (nginx, IIS) to redirect it to the correct application.

But you can also use UseWhen

for branching.



app.UseWhen(context => context.Request.Path.StartsWith("dashboard"), appBuilder =>
{
    // register here branched middlewares etc. 
}

      

But that's not exactly what you asked for though

+1


source


You may be interested in .NET MVC Scopes

According to MSDN documentation: "Scope is actually the MVC structure inside the application"



This allows you to have a completely separate routing scheme and parallel structure for your internal needs. You can have everything the same except for the area prefix.

+1


source







All Articles