Module export format changed to Fetchr Class
Breaking changes:
-
Fetchr now exports the class itself, rather than the class creating factory function.
var Fetcher = require('fetchr')(), //Fetcher class fetcher = new Fetcher(); //Fetcher instance
now becomes
var Fetcher = require('fetchr'), //Fetcher class fetcher = new Fetcher(); //Fetcher instance
-
addFetcher
method renamed toregisterFetcher
. This is to keep the api somewhat consistent between fetchr and dispatchr. -
Fetcher.middleware()
should no longer be mounted directly on the app. It should always be mounted on a path.app.use(Fetcher.middleware());
now becomes
app.use('/api', Fetcher.middleware());
-
pathPrefix
config option renamed toxhrPath
.- This config option used to be passed into the class creator function, but is now passed into the class upon instantiation.
- This option's value should point to the exact path the
Fetcher.middleware()
was mounted on.