Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add cname example

  • Loading branch information...
commit 8e1b10acbffc7bef6eef982ca07f83eb37590c8d 1 parent 278de59
Christian Tellnes authored
Showing with 18 additions and 0 deletions.
  1. +18 −0 examples/addCname.js
18 examples/addCname.js
View
@@ -0,0 +1,18 @@
+var cloudfront = require('..');
+
+var cf = cloudfront.createClient(process.env.AWS_KEY, process.env.AWS_SECRET);
+
+cf.getDistributionConfig(process.argv[2], function(err, config) {
+ if (err) throw err;
+
+ config.cname.push.apply(config.cname, process.argv.slice(3));
+
+ console.log(config);
+ console.log(cf.generateDistributionXml(config));
+
+ cf.setDistributionConfig(process.argv[2], config, function(err, config2) {
+ if (err) throw err;
+
+ console.log(config2);
+ });
+});
Please sign in to comment.
Something went wrong with that request. Please try again.