1.0.3 • Published 9 years ago
ftv-node-angular-pregen v1.0.3
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.gitRequired dependencies
Installation
npm install ftv-node-angular-pregenDev requirement
npm install -g gulp
npm installJS Linter
gulp js-lintDemo
Installation
gulp demothen requiring nodemon or pm2
npm install -g nodemon
nodemon demo/server.js --expose-gcnpm install -g pm2
pm2 start demo/server.js --node-args='--expose-gc' --watchIn 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)