如何将Angular 4应用程序与Spring Boot堆栈集成?
发布时间:2020-12-17 07:25:22 所属栏目:安全 来源:网络整理
导读:我想将一个Angular 4客户端应用程序与一个工作在http:// localhost:8080 /上的 Java Spring应用程序集成,并提供一些Rest端点. 我的目标是能够从http:// localhost:8080 / adminisitration这样的URL调用Angular应用程序.我怎样才能做到这一点? 提前致谢,
我想将一个Angular 4客户端应用程序与一个工作在http:// localhost:8080 /上的
Java Spring应用程序集成,并提供一些Rest端点.
我的目标是能够从http:// localhost:8080 / adminisitration这样的URL调用Angular应用程序.我怎样才能做到这一点? 提前致谢,
你需要刺激构建你的应用程序并将其放在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,它应该工作正常 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐
热点阅读