Last active
August 29, 2015 14:26
-
-
Save rgbkrk/5f0d2460b68381a5ccbf to your computer and use it in GitHub Desktop.
Get CDN URL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var pkgcloud = require('pkgcloud'); | |
| var client = pkgcloud.storage.createClient({ | |
| provider: 'rackspace', | |
| username: process.env.RS_USERNAME, | |
| apiKey: process.env.RS_API_KEY, | |
| region: process.env.RS_REGION_NAME | |
| }); | |
| client.createContainer({ | |
| name: 'testContainer4' | |
| }, function(err, container) { | |
| container.enableCdn(function(err) { | |
| client.getContainer(container, function(err, container) { | |
| // Can now get any of: | |
| // container.cdnUri | |
| // container.cdnSslUri | |
| // container.cdnStreamingUri | |
| // container.cdniOSUri | |
| console.log(container.cdnSslUri); | |
| }); | |
| }); | |
| }); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment