4.6.4.3. Using Native Polymer Tools

You can use native Polymer framework toolchain when developing Polymer UI components. It can be convenient if a separate team of front-end developers works on the project. In this case Node.js should be installed on the system.

Install bower and gulp globally:

npm install bower gulp-cli -g

Then you can build and run the web application without Gradle:

cd modules/polymer-client
npm install
bower install
gulp serve

You need to apply the following changes in the source code if you want to serve app by polymer server (instead of Tomcat):

  • Open modules/polymer-client/index.html and edit base element as follows:

    <base href="/">
  • Open modules/polymer-client/src/<appname>-shell.html and edit cuba-app element as follows:

    <cuba-app api-url="http://localhost:8080/app/rest/" on-cuba-token-expired="_handleTokenExpired"></cuba-app>

After that, the web application will be available at http://localhost:8081 and it will work with the REST API running at http://localhost:8080/app/rest/.