Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to combine Angular-Cli frontend to Spring-boot backend

I currently have a web application that runs an Angular 2 frontend, and a Spring Boot backend.

I have followed this tutorial in order to integrate the two components.

http://blog.jdriven.com/2016/12/angular2-spring-boot-getting-started/

My application now has the same structure as this

https://github.com/jbruinink/ng2boot

The frontend and backend can now be built with a single command. However the frontend and backend generate seperate jars, and need to be started seperately.

Is there a way to package my appliacation in a single jar that starts both the frontend and the backend?

like image 815
Seeker Avatar asked Feb 06 '17 15:02

Seeker


1 Answers

That question was actually asked and answered in the comment section:

"The frontend is actually packaged into the backend jar. You can simply start the backend and go to http://localhost:8080. The development server at port 4200 is optional. It just makes it easier to develop the frontend, because all changes are reloaded automatically."

like image 154
Jeroen Avatar answered Oct 27 '22 21:10

Jeroen