seriema / angular-apimock

Automatically route your API calls to static JSON files, for hiccup free front–end development.
johansson.jp/angular-apimock
MIT License
65 stars 8 forks source link

Increase flexibility in API-url replacement #16

Closed seriema closed 9 years ago

seriema commented 10 years ago

Currently apiMock simply does a string.replace to change apiPath into mockDataPath.

Two other options could be added:

  1. Use a regex for apiPath.
  2. Use a method for mockDataPath.
seriema commented 9 years ago

Does anyone really want this or was I just feature-creeping?

Wolfium commented 9 years ago

+1, excellent work, I thought on being backward compatibility being able to handle an array of strings and/or regexs leaving simple string to not get a breaking change.

By the way the only issue I have is only work with true option, don't work if I use auto or number for status code. Even not working in demo http://johansson.jp/angular-apimock/#/demo-simple?apimock=auto

seriema commented 9 years ago

@Wolfium I created an issue for the bug you reported: #37 Feel free to add any details if you'd like.