title: Asp.net core 2.1 - How to serve multiple angular apps?
body: <p>I'm trying to serve 2 angular apps from my .net core service like this:</p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services)
  {
      ...
  
      services.AddSpaStaticFiles(configuration =&gt;
      {
          configuration.RootPath = "wwwroot/app";
      });
  
      services.AddSpaStaticFiles(configuration =&gt;
      {
          configuration.RootPath = "wwwroot/admin";
      });
  
      ...
  }
  
  public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
  {
      ...
  
      app.UseSpaStaticFiles(new StaticFileOptions
      {
          OnPrepareResponse = ctx =&gt;
          {
              ctx.Context.Response.Headers.Append("Cache-Control", "public,max-age=0");
          }
      });
  
      app.UseMvc();
  
      app.Map("/app", client =&gt;
      {
          client.UseSpa(spa =&gt;
          {
              spa.Options.SourcePath = "wwwroot/app";
          });
      }).Map("/admin", admin =&gt;
      {
          admin.UseSpa(spa =&gt;
          {
              spa.Options.SourcePath = "wwwroot/admin";
          });
      });
  }
  </code></pre>
  
  <p>in the file system, I only have the <code>dist</code> output of these apps (since they are developed by another team). So it looks like this:</p>
  
  <ul>
  <li>C:[MY PROJECT PATH]\wwwroot\app</li>
  <li>C:[MY PROJECT PATH]\wwwroot\admin</li>
  </ul>
  
  <p>But for some reason, the admin app works and the app doesn't and also it doesn't support a default page so I need to enter the URL with <code>/index.html</code>.</p>
  
  <p>Any ideas on how to solve this?</p>