How to configure ASP.net Core server routing for multiple SPAs hosted with SpaServices : <p>I have an Angular 5 application that I want to host with Angular Universal on ASP.net Core using the latest <a href="https://docs.microsoft.com/en-us/aspnet/core/spa/angular" rel="noreferrer">Angular template RC</a>. I've followed the docs and have the application up and running. The problem is that I am also using Angular's <a href="https://angular.io/guide/i18n" rel="noreferrer">i18n tools</a>, which produce multiple compiled applications, 1 per locale. I need to be able to host each from <code>https://myhost.com/{locale}/</code>.</p>

<p>I know that I can spin up an instance of the ASP.net Core app for each locale, and set up hosting in the webserver to have the appropriate paths route to the associated app, but this seems excessive to me.</p>

<p>Routes are configured with:</p>



<pre class="lang-cs prettyprint-override"><code>// app is an instance of Microsoft.AspNetCore.Builder.IApplicationBuilder
app.UseMvc(routes =&gt;
{
    routes.MapRoute(
        name: "default",
        template: "{controller}/{action=Index}/{id?}");
});
</code></pre>

<p>SpaServices are configured with:</p>

<pre class="lang-cs prettyprint-override"><code>app.UseSpa(spa =&gt;
{
    // To learn more about options for serving an Angular SPA from ASP.NET Core,
    // see https://go.microsoft.com/fwlink/?linkid=864501

    spa.Options.SourcePath = "ClientApp";

    spa.UseSpaPrerendering(options =&gt;
    {
        options.BootModulePath = $"{spa.Options.SourcePath}/dist-server/main.bundle.js";
        options.BootModuleBuilder = env.IsDevelopment()
            ? new AngularCliBuilder(npmScript: "build:ssr:en")
            : null;
        options.ExcludeUrls = new[] { "/sockjs-node" };
        options.SupplyData = (context, data) =&gt;
        {
            data["foo"] = "bar";
        };
    });

    if (env.IsDevelopment())
    {
        spa.UseAngularCliServer(npmScript: "start");
    }
});
</code></pre>

<p>I've looked through the documentation and the source on Github, and I cannot find how to configure ASP.net Core to associate a specific route with a given SPA. Anyone have any ideas?</p>
