简体   繁体   中英

angular-php api not found after minification

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

angular-php

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?

Oops. Seems I forgot a /.

Should have been /dist/api/features

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM