Universal Angular Application
This project was generated with Angular CLI version 8.0.0-beta.5.
This starter kit contains all the minimal tooling and configuration you need to kick off your next universal Angular 8 project.
- angular 8 as universal web application platform
- module-map-ngfactory-loader 7 as server side rendering of lazy routes
- angular/cli 8 as code scaffolder
- webpack 4 as module bundler
- node as server
- express as request handler
- udk-builder as architect builder
- ng-udkc as extreme live development container to reload all the things!
Important: HMR doesn't work yet on server side with lazy routes (but works in browser side). We are trying to find a way which fixes this issue and we're still opened for possible solutions.
git clone https://github.com/enten/angular-universal my-project cd my-project npm install npm start
git clone https://github.com/enten/angular-universal -b material my-project cd my-project npm install npm start
git clone https://github.com/enten/angular-universal -b toh my-project cd my-project npm install npm start
git clone https://github.com/enten/angular-universal -b i18n my-project cd my-project npm install npm run start:fr
Two different dev servers are provided:
- The universal dev server which enable SSR (build
- The SPA dev server which is a webpack dev server (build
SPA dev server can be useless (or "broken"): it depends on your server implementation.
Universal dev server
npm run dev (or
npx ng-udkc) for an universal dev server. Navigate to http://localhost:4000/.
The app will automatically hot-reload on server and browser sides if you change any of the source files.
The server will automatically restart if a change occured in
metadirs defined in udk.container.js.
SPA dev server
npm run dev:spa (or
npx ng serve --hmr) for a SPA dev server Navigate to http://localhost:4200/.
The app will automatically reload if you change any of the browser source files.
Note: the universal dev server provide an SPA mode too if you navigate to the
ng generate component component-name to generate a new component. You can also use
ng generate directive|pipe|service|class|guard|interface|enum|module.
npm run build to build the project. The build artifacts will be stored in the
npm run build:prod for a production build.
Running unit tests
ng test to execute the unit tests via Karma.
Running end-to-end tests
ng e2e to execute the end-to-end tests via Protractor.
To get more help on the Angular CLI use
ng help or go check out the Angular CLI README.