This template provides a base for developing a web application which includes a ReactJS client-side application and an HTTP web server for serving both static content and an API emitting JSON (or another data format).
-
Make sure you've followed the Getting Started Guide.
-
Download the template
-
Unzip the resulting download and move the contents of
webapp/
to a directory of your choosing. -
cd webapp/
-
Initialize your repository.
git init
- Add your first commit.
git add .
git commit -m "Initial structure per template."
-
sbt
-
reStart
-
Navigate to http://localhost:8083 to see the front-end.
-
Navigate to http://localhost:8083/api/hello to see a sample service response.
- Dynamically recompile as you make changes via:
~compile
. - Dynamically restart the service as you make changes via
~reStart
.
Changes to the front-end code will be applied as you make them, even if you only run the reStart
command without the ~
. If you make changes to the frontend build configuration and need to restart npm
, you'll have to use reStop
to stop the background npm
process, then run reStart
again to restart it.
There's a slight lag, but keep an eye on your sbt
console for information regarding the front-end build.
Running a Virtualbox with Ubuntu is recommended. Check out this guide for details.