Thursday, November 12, 2020

Building Server Side Rendered Apps with the Angular

Building Server Side Rendered Apps with the Angular

First you need to have Git installed on your system. You need also to have Node.js and NPM installed and configured.

Building Server Side Rendered Apps with the Angular

Next clone the Universal Starter from Github with:

git clone https://github.com/angular/universal-starter.git universal-demo 

Then navigate inside the cloned repo and install the required dependencies with:

npm install 

After successfully installing all requirements you can start the development server using:

npm start

After building your application you can create a production bundle using:

npm run build:prod

You should do that only on client side code and make sure to wrap them inside isBrowser function

import { isBrowser } from 'angular2-universal'  

No comments:

Post a Comment