How to deploy a create-react-app boilerplate to a Java EE Servlet engine
Clone or download
Latest commit 6afcfc4 Sep 20, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
public Initial commit Sep 19, 2017
src App.js and pom.xml Sep 19, 2017
.gitignore App.js and pom.xml Sep 19, 2017
LICENSE App.js and pom.xml Sep 19, 2017
README.md Fixed README file Sep 20, 2017
README.original.md Modified README file Sep 19, 2017
package.json Added react-router Sep 19, 2017
pom.xml App.js and pom.xml Sep 19, 2017
web.xml App.js and pom.xml Sep 19, 2017
yarn.lock Initial commit Sep 19, 2017

README.md

Sample code for
http://www.megadix.it/blog/create-react-app-servlet/

Quickstart

  1. Build project using Maven:
mvn package

The project is configured to build local profile by default.

  1. Deploy create-react-app-servlet.war to your favourite servlet engine

  2. Access application at
    http://localhost:8080/create-react-app-servlet/

Note: depending on your environment you would need to change PUBLIC_URL and REACT_APP_ROUTER_BASE in profiles. For example, Weblogic uses port 7001 instead of 8080.

Production Build

To produce a production build, run maven with the -Pprod switch:

mvn package -Pprod