前端之家收集整理的这篇文章主要介绍了
如何将Angular 4应用程序与Spring Boot堆栈集成?,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我想将一个Angular 4客户端应用程序与一个工作在http:// localhost:8080 /上的
Java Spring应用程序集成,并提供一些Rest端点.
我的目标是能够从http:// localhost:8080 / adminisitration这样的URL
调用Angular应用程序.我怎样才能做到这一点?
提前致谢,
@H_
301_5@
你需要刺激构建你的应用程序并将其放在spring-boot
文件夹中
1. Create a public folder under resources in your spring-boot project
2. ng build --prod,type this command on you angular project which will create a dist folder under your angular project directory
3. copy files from you dist folder and place it in public folder under resources of your spring-boot project.
这将帮助您在spring-boot下运行angular-app.
然后打到http://localhost:8080/adminisitration,它应该工作正常