Created
July 4, 2015 06:58
-
-
Save glynnbird/5175574163e38bf3693f to your computer and use it in GitHub Desktop.
Adding a virtual host to Cloudant via the API from the Node.js library using a custom request
This file contains 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 cloudant = require("cloudant")("https://MYUSER:MYPASSWORD@MYUSER.cloudant.com"); | |
var obj = { | |
method: "POST", | |
path: "_api/v2/user/virtual_hosts", | |
body: { host: "vhost.glynnbird.com"} | |
}; | |
cloudant.request(obj, function(err, data) { | |
// null { ok: true } | |
console.log(err,data); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you can supply a path too { host: "vhost.glynnbird.com", path: "/mypath"}