This repository contains a simple (and very initial) example of using angular-universal with java backend using J2V8.
##Features:
- Rendering using angular universal from java using J2V8
- Serving both the application and other rest endpoint from java using sparkjava
- Basic live-reload support for the universal server build
- Linux x64 only
- Multi-Node (each in its own thread) rendring
- Java level cache for increasing performance (using the cache assumes that the render function is pure)
- The renderer itself (not including the usage example) dependes on J2V8 and Guava
##TODO:
- Fetch J2V8 from maven central
- Support other platforms
- Performance tests
- Documentation and code-cleanup
- Orginize project structure
- Implement a more complex client side application
Check if can model the bootstrap configuration object in java in order to remove the need for server.js completelyCleanup and improvement of the JavaEngine (currently almost blindly based on the expressEngine)Remove the direct gson dependencyExpose the cache through configurationMake the configuration object api fluid
##Requirements
- x64 Linux (tested on ubuntu 16.04)
- Java 8
- Maven
- NPM
##Running Instructions
- Clone the repository
- Install node dependencies (
npm install
) - Build the java server(
mvn clean package
) - Build&Watch angular-universal + angular client side code (
npm start
) - Execute the java server (
mvn -e exec:java -Dexec.mainClass="hello.ngu.j2v8.Server"
) - Open your browser on
http://localhost:3000/app/
##Links
###Thanks and credits
- The Angular-Universal-related files are based on Angular 2 Universal starter kit with very small modifications
- Special thanks to @irbull for the great J2V8 library and he's help.