mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-04-29 07:24:02 -04:00
Activate after configuring Fastly
This commit is contained in:
parent
f90adfcadb
commit
494085247d
2 changed files with 40 additions and 4 deletions
bin/lib
|
@ -109,5 +109,30 @@ module.exports = function (apiKey, serviceId) {
|
|||
return cb(null, response);
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
/*
|
||||
* cloneVersion: Clone a version to create a new version
|
||||
*
|
||||
* @param {number} Version to clone
|
||||
* @param {callback} Callback for fastly.request
|
||||
*/
|
||||
fastly.cloneVersion = function (version, cb) {
|
||||
if (!this.serviceId) return cb('Failed to clone version. No serviceId configured.');
|
||||
var url = this.getFastlyAPIPrefix(this.serviceId, version) + '/clone';
|
||||
this.request('PUT', url, cb);
|
||||
};
|
||||
|
||||
/*
|
||||
* activateVersion: Activate a version
|
||||
*
|
||||
* @param {number} Version number
|
||||
* @param {callback} Callback for fastly.request
|
||||
*/
|
||||
fastly.activateVersion = function (version, cb) {
|
||||
if (!this.serviceId) return cb('Failed to activate version. No serviceId configured.');
|
||||
var url = this.getFastlyAPIPrefix(this.serviceId, version) + '/activate';
|
||||
this.request('PUT', url, cb);
|
||||
};
|
||||
|
||||
return fastly;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue