Grunt serve + PHP?

后端 未结 3 2099
Happy的楠姐
Happy的楠姐 2021-02-09 13:23

I\'m starting my first project with yo + grunt + angular.js.
I have a service which needs to read some data from my server; I built it using angular $http service. I\'ve als

3条回答
  •  青春惊慌失措
    2021-02-09 13:55

    Our solution to the problem at work was to create flat files with sample data inside the app folder and use relative URLs with $resource and $http and then deploy our code as an application at the same subdirectory level... /fx/api/fund for example.

    This allows grunt to serve up something static for seeing what the design will look like of the Angular app while still providing a full experience. Then we have a development server that gets updated when we commit code (using Jenkins) that we can check for real functionality and run our test suite against.

    This approach is a little clumsy but it allows us to get the benefits of the grunt approach and still have a testing server. We also have our builds use the minified version so that we can test that magnification won't break the app.

    The only problem with this approach is that the built in web server with grunt can't handle post requests so anything calling a post will fail.

提交回复
热议问题