I am using grunt for my angular js app, and tomcat for my server side.
Whenever needed, in dev env, I run Grunt build, takes dist folder and put it in tomcat webapp folder.
However, I have a weird issue. URLs within the app work only if I click on them from an HTML page.
e.g. if I type http://localhost:8080/upload
- I will get 404 page not found error
, however if from index page - http://localhost:8080
, I click on a link in page that leads to upload it works fine.
What could be the problem?
If I run the app on node.js, the links work perfectly! just on Tomcat it doesn't work as expected.
EDITED
I define the urls like this in angular js
angular.module('angularjsApp')
.config(function ($stateProvider) {
$stateProvider
.state('upload', {
url: '/upload',
templateUrl: 'app/upload/upload.html',
controller: 'UploadCtrl'
});
});