Giter VIP home page Giter VIP logo

dotnetcore-angular-ssr's Introduction

The goal of this project was to create and configure a minimal spa setup with the following attributes:

  • Latest version of ASP.NET Core (2.2)
  • Latest version of Angular (7)
  • SSR using Angular Universal
  • No need to deploy node_modules folder for SSR

The project was created in 3 steps. See the commit history for specific file changes.

  1. Create a base ASP.NET Core web application
dotnet new web
  1. Create a base client app using Angular CLI
ng new ClientApp
  1. Configure ASP.NET to host client app and perform server side prerendering. See commit https://github.com/joshberry/dotnetcore-angular-ssr/commit/952f37cfde11c8fa80e36d6982887133e6c3fd55.

dotnetcore-angular-ssr's People

Contributors

joshberry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dotnetcore-angular-ssr's Issues

process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";

This type is unsafe!
I undersand that with this flag page will render fetch data, BUT
if you are using !http (client and server) page will render data correctly and SET CORS.
if you are using https on server and !http! on client you will see that from browser no errors, but server logs that request error.

Upgrade

Any chance for update to use angular 9?
I was able to upgrade to dotnet 3.1 and it still works.
After upgrade to angular 9 there is "TimeoutException: The Angular CLI process did not start listening for requests within the timeout period of 0 seconds".

Cheers!

How to config several productions when using ssr & i18n ?

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?

Is it possible to deploy this app?

So in this template was remove few lines:

 if (env.IsDevelopment())
       {
           app.UseDeveloperExceptionPage();
       }
   else
       {
          app.UseExceptionHandler("/Error");
       }

and we couldnt see error page if something goes wrong. So in local machine it works well, but on iis it wont.
Did you try to deploy this template?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.