I've been in hard-code fake data land and It's not pretty. I use a slightly different solution for this:
1. use the api address as a constant that services that need it can inject
2. use
grunt ngconstant to allow me to switch between configurations easily (mock, staging, production, whatever) - in this config module I set the api address
3. use
Dyson which is a simple and great fake api server (supporting get, post, delete, put, dynamic template generation etc and also just returning hardcoded JSON) and. where I setup endpoints ( the docs are good) and configure the dyson api as one of the config options (like API_ADDRESS=
http://localhost:8088/. and configure dyson to listen to that port
4. enjoy
Also notice the the dyson #dev version (you'll need to npm install -g from github with the branch name) supports proxying to the real api (and I know, because I asked for the feature and currently beta testing it :) )
if you setup a dyson.json with the proxying data - so If you remove (or comment..) a mock endpoint from dyson config you'll have the request proxied to your real api. that allows me to remove fake endpoint as they are being implemented by the backend guys,
Hope that helps!