2016-03-09 23:23

minification后找不到angular-php api

I scaffolded a basic angular-php yeoman app to try it out.


When I run grunt serve it works as expected and pulls some data using rest using $http.get('/api/features')....

When I minifiy the project it creates a dist folder which I assumed could be dropped onto a webserver so I dropped it onto XAMPP and browsed to localhost:8000/dist.

The site loads ok but it cannot find the api

localhost:8000/api/features not found

when I browse to localhost:8000/dist/api/features it returns the json so the api is functioning, so I changed the get url to $http.get('dist/api/features') only this time it says

localhost:8000/dist/dist/api/features not found

What am I missing?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答


  • dsgsdg206050 dsgsdg206050 5年前

    Oops. Seems I forgot a /.

    Should have been /dist/api/features

    点赞 评论 复制链接分享