【发布时间】:2019-09-06 16:00:40
【问题描述】:
我应该如何在 tomcat 8.5 上部署我的 Angularjs 代码
我尝试将我的项目文件夹复制到 tomcat 中的 webapps 文件夹
我的项目结构
webapps
myprojectname
controllers
css
views
route.js
index.html
config.js
route.js 文件
angular.module("testroutes",["ngRoute"]).config(['$routeProvider', function($routeProvider) {
$routeProvider.
when('/', {templateUrl: 'views/home.html'}).
when('/home', {templateUrl: 'views/home.html',controller: 'homecontroller'}). otherwise({redirectTo: '/'});
}]);
tomcat 已开始运行我所有的控制器,正在加载 html 但路由不起作用。
localhost:8080/myprojectname/home --> 给我 404
只有 localhost:8080/myprojectname/ --> 这有效。正在加载 index.html
我的路由不工作。有人可以帮忙吗
【问题讨论】: