小编Hen*_*wei的帖子

如何在同一个域/服务器上部署AngularJS app和Spring Restful API服务?

我是Spring和AngularJS的新手.我按照这里的步骤构建后端restful API,并根据请求发送Json.因此,根据指南,当我运行"mvn spring-boot:run"时,tomcat服务器从localhost:8080开始.

然后我使用Yeoman角度生成器来构建我的角度应用程序.当我在我的角度应用程序中运行"grunt serve"时,前端应用程序运行在localhost:9000.

我应该怎么做才能使我的角度应用程序可以与我在同一域上的Springboot tomcat服务器一起提供,比如localhost:8080?

我可以遵循一个示例项目吗?我找到了以下项目,但仍然无法使其工作,因为我没有太多关于tomcat的背景知识.

  1. https://github.com/robharrop/spring-angularjs
  2. https://github.com/GermanoGiudici/angularjs-maven-tomcat-seed
  3. https://github.com/xvitcoder/spring-mvc-angularjs

spring tomcat angularjs yeoman spring-boot

26
推荐指数
1
解决办法
2万
查看次数

标签 统计

angularjs ×1

spring ×1

spring-boot ×1

tomcat ×1

yeoman ×1