Giter Site home page Giter Site logo

angular-ssr-example's Introduction

Server-Side Rendering Example based on Angular Universal, includes tips for SEO improvements

Why Use Server-Side Rendering?

  • Improve Search Engine Optimization (SEO) and ready for Social Media sharing
  • Show the first page quickly
  • Improve performance for low-powered devices

Prerequisites

Install all dependencies

npm install

Run application in classic SPA mode (client-side rendering, aka CSR):

Development of SPA apps with Dev Server

npm start

or

Run production ready CSR app

npm run demo-csr

Run application in SSR mode:

Development of SSR apps with Dev Server

npm run dev:ssr

or

Run production ready SSR app

npm run build:ssr && npm run serve:ssr

Angular Universal allows prerender web pages

It allows to cache pages as static files, which can then be served to the client via CDN or a simple server

npm run prerender

For deployment, you can publish SSR app to Amazon Lambda

aws configure 

Build application and create package for Lambda:

npm run build:sls

Deploy to AWS Labmda:

npm run deploy:sls

Finaly, you should see your app published, like: https://wzu32gvx3b.execute-api.us-east-1.amazonaws.com/production/ or https://d1zys4h7ryi3cv.cloudfront.net/production/

angular-ssr-example's People

Contributors

4z5lz avatar alexsavenok avatar

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.