Comparing version 1.2.2 to 1.3.0
@@ -27,3 +27,3 @@ var url = require('url') | ||
return flat.concat(route) | ||
}, []).filter(Boolean) | ||
}, Array.isArray(opts.urls) ? opts.urls : [opts.urls]).filter(Boolean) | ||
@@ -77,3 +77,3 @@ if (routes.length <= limit) { | ||
port: 443, | ||
path: `/client/v4/zones/${opts.zone}/purge_cache`, | ||
path: '/client/v4/zones/' + opts.zone + '/purge_cache', | ||
method: 'POST', | ||
@@ -80,0 +80,0 @@ headers: { |
{ | ||
"name": "cccpurge", | ||
"version": "1.2.2", | ||
"version": "1.3.0", | ||
"description": "Choo Cloudflare Cache Purge – purge all routes served by choo app", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -26,3 +26,3 @@ # cccpurge | ||
### Dynamic routes | ||
Dynamics routes (wildcards/params) are supported out of the box but you'll have to supply a function that resolves them to actual urls. The resolve function is given the route (e.g. `/posts/:post`) and a callback. How you resolve `/posts/:post` to `/post/my-first-post` is completely up to you. Here's an example using [Prismic][prismic]. | ||
Dynamics routes (wildcards/params) are supported but you'll have to supply a function that resolves them to actual urls. The resolve function is given the route (e.g. `/posts/:post`) and a callback. How you resolve `/posts/:post` to e.g. `/post/my-first-post` is completely up to you. Here's an example using [Prismic][prismic]. | ||
@@ -69,2 +69,13 @@ ```javascript | ||
### Options | ||
- __opts.limit:__ default: `30`. Number of urls submited per request. | ||
- __opts.urls:__ default: `[]`. List of urls (other than routes) you want purged. | ||
- __opts.zone:__ Cloudinary Zone ID. | ||
- __opts.email:__ Cloudinary account email address. | ||
- __opts.key:__ Cloudinary API Key. | ||
- __opts.resolve:__ Function which resolves dynamic routes to urls. | ||
## License | ||
MIT | ||
[choo]: https://github.com/choojs/choo | ||
@@ -71,0 +82,0 @@ [prismic]: https://prismic.io |
7720
89