Correct preview route for fastly

- use more explicit route
- handle fastly error in the callback correctly
- more succinct parsing of the URL path
This commit is contained in:
chrisgarrity 2018-05-02 17:01:52 -04:00
parent d1420862ea
commit 6df58e41fd
3 changed files with 11 additions and 23 deletions

View file

@ -176,7 +176,7 @@ async.auto({
if (err) throw new Error(err);
if (process.env.FASTLY_ACTIVATE_CHANGES) {
fastly.activateVersion(results.version, function (e, resp) {
if (err) throw new Error(e);
if (e) throw new Error(e);
process.stdout.write('Successfully configured and activated version ' + resp.number + '\n');
if (process.env.FASTLY_PURGE_ALL) {
fastly.purgeAll(FASTLY_SERVICE_ID, function (error) {