joshberry / dotnetcore-angular-ssr

Starting point for spa application using ASP.NET Core and Angular 7 with server side rendering enabled
https://dotnetcore-angular-universal.azurewebsites.net
41 stars 10 forks source link

How to config several productions when using ssr & i18n ? #6

Closed jkhadivi closed 5 years ago

jkhadivi commented 5 years ago

Thank you for your very good project, im using i18n and i have 2 production (mysite.com/en & mysite.com/es) . when i use ssr , mapping does not work properly and alwayse map on first mapping code, for example on es : ` app.Map("/es", spaFa => {

            app.UseSpa(spa =>
             {
                 spa.Options.SourcePath = "ClientApp";
                 spa.Options.DefaultPage = $"/es/index.html";
                 spa.UseSpaPrerendering(options2 =>
                 {
                     options2.BootModulePath = $"{spa.Options.SourcePath}/dist-server/main.js";
                     options2.ExcludeUrls = new[] { "/sockjs-node" };
                 });

             });
        });
        app.Map("/en", spaFa =>
               {
                   app.UseSpa(spa =>
        {
            spa.Options.SourcePath = "ClientApp";
            spa.Options.DefaultPage = $"/en/index.html";

            spa.UseSpaPrerendering(options2 =>
            {
                options2.BootModulePath = $"{spa.Options.SourcePath}/dist-server/main.js";
                options2.ExcludeUrls = new[] { "/sockjs-node" };
            });

        });
               });`

Can you guide?

jkhadivi commented 5 years ago

resolved!