Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

server side rendering in agular

//first step:
ng add @nguniversal/express-engine
//second step:
npm run dev:ssr
//third step:
ng build && ng run app-name:server
//fourth step:
npm run serve:ssr
//fifth step:
npm run prerender
//sixth step:
npm run serve:ssr


//diff method:
ng add @nguniversal/express-engine

//angular.json file change:
"server": {
          "builder": "@angular-devkit/build-angular:server",
          "options": {
            "outputPath": "dist-server",
            "main": "server.ts",
            "tsConfig": "tsconfig.server.json",
            "inlineStyleLanguage": "scss"
          },
//package.json file change:
            "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test",
    "dev:ssr": "ng run test-universal:serve-ssr",
    "serve:ssr": "node dist-server/main.js",
    "build:ssr": "ng build && ng run test-universal:server",
    "prerender": "ng run test-universal:prerender"
              
//run command:
  ng run test-universal:server
  ng run build:ssr
  npm run serve:ssr
Comment

angular server side rendering

ng add @nguniversal/express-engine
npm run dev:ssr
Comment

PREVIOUS NEXT
Code Example
Javascript :: var x = 
Javascript :: react js http post 500 internal server error 
Javascript :: jquery class selector 
Javascript :: image react 
Javascript :: string remove last two characters javascript 
Javascript :: change console log to print javascript 
Javascript :: sublime javascript autocomplete 
Javascript :: Function Alert,confirm,prompt 
Javascript :: explain the exclamation mark in js 
Javascript :: moment format yyyy-mm-dd 
Javascript :: disable long press on chrome 
Javascript :: how to send response to client in nodejs using res object 
Javascript :: export component react 
Javascript :: volume slider javascript 
Javascript :: is vowel javascript 
Javascript :: static js 
Javascript :: windows scroll condition 
Javascript :: findone mongoose 
Javascript :: removes null and false values from an array 
Javascript :: logic operators in js 
Javascript :: how to include script file in javascript with javascript 
Javascript :: jquery selector class child 
Javascript :: javascript array column 
Javascript :: javascript array read object value in array 
Javascript :: React-redux and redux 
Javascript :: area of a triangle javascript 
Javascript :: How to create a GUID / UUID 
Javascript :: react props have changed method 
Javascript :: react form hook npm 
Javascript :: method chaining in javascript 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =