Skip to main content

Posts

Showing posts from October, 2018

Setting up a nice dev/prod workflow for Vue-CLI frontend apps using Spring backend

My current recipe which works not bad is setup spring at localhost:8082, vue-cli app on localhost:8080 setup proxy in devServer for webpack to point all /api calls to localhost:8082. So now any calls made from vue application to /api will be sent to the spring application at /api setup spring api endpoints at /api add a 'buildx' npm task to do the usual "vue-cli build && copy " over to spring src/main/resources/static area, mine usually looks like this in package.json "buildx" : "vue-cli-service build && copyfiles -u 1 dist/* dist/**/* ../build/resources/main/public && copyfiles -u 1 dist/* dist/**/* ../src/main/resources/public -V" ,   I usually copy to both build/ and src area, since build makes restart instantliy work in spring side, and src/ area makes bundle available in spring jar file created using bootJar task, for deployment setup devtools on spring to autorestart I can dev/test using jus