1.0.3 • Published 8 years ago

ftv-node-angular-pregen v1.0.3

Weekly downloads
8
License
proprietary
Repository
github
Last release
8 years ago

FTV - NodeJS AngularJS Pregen

This project is part of francetv zoom open source projects (iOS, Android and Angular).

NodeJS server used to generate AngularJS page.

Get sources

git clone git@github.com:francetv/ftv-node-angular-pregen.git

Required dependencies

Installation

npm install ftv-node-angular-pregen

Dev requirement

npm install -g gulp
npm install

JS Linter

gulp js-lint

Demo

Installation

gulp demo

then requiring nodemon or pm2

npm install -g nodemon
nodemon demo/server.js --expose-gc
npm install -g pm2
pm2 start demo/server.js --node-args='--expose-gc' --watch

In the demo we require using garbage collector because current jsdom version still has memory leak

Explanation

  • Server
    • Api Service - Retrieving "view data" according the url
    • Pregen page with the "view data" and on the required librairies
    • Inserting in the snapshot the "view data" in a angular module
    • Sending snapshot to the client
  • Client
    • Initializing the angular app
    • Building the page with the "view data" retrieved from the inserted angular modules (prevent to call again the api - server side only)
1.0.3

8 years ago

1.0.2

8 years ago