This is a minimal example application that uses VueJS on the front-end and Vert.x on the back-end.
API is exposed on paths starting with /api
and contains only a single method, /api/health
.
The back-end serves the front-end on all other paths.
The front-end consists of a single component that displays the health status of the back-end.
To compile both FE and BE to a single JAR file, execute:
mvn clean && \
npm run build && \
mvn compile assembly:single
or as an npm script:
npm run package:jar
This will:
- remove all files from the
target
directory - build the front-end with
npm run build
- install the dependencies
- build app with
vue-cli-service
- write result to
target
directory
- compile back-end sources and package them together with front-end to a single JAR
Repackaging the JAR file on every change would slow down the local development. Both applications may be run separately to avoid this issue.
The back-end application may be run with the following command:
mvn exec:java \
-Dexec.mainClass="jezorko.com.github.example.VertxVueApplicationKt"
By default, it will run on port 3000
.
Bear in mind the front-end will no be accessible through back-end if running this way.
To only compile frond-end sources and run them in a development server, execute:
npm start
This will talk with the back-end running on localhost on port 3000
(default).