Permalink
Browse files

Update README about external config

  • Loading branch information...
1 parent 8823136 commit e21cf8ebc8c699e96e16264db0b3c82a0ee6a9ab @judofyr committed Dec 11, 2011
Showing with 13 additions and 0 deletions.
  1. +13 −0 README.md
View
@@ -92,3 +92,16 @@ Mockie also let's you define configuration in your files:
This JSON structure is available as `Mockle.config`.
+If you need to fetch the configuration from another file, just expose a
+function:
+
+```javascript
+Mockie.expose({
+ fetchConfig: function(done) { done(Mockie.config) }
+});
+
+Mockie.request('file.html', 'fetchConfig', function(cfg) {
+ console.log(cfg);
+});
+```
+

0 comments on commit e21cf8e

Please sign in to comment.