Skip to content

Instantly share code, notes, and snippets.

View ljaniszewski's full-sized avatar

Leszek Janiszewski ljaniszewski

View GitHub Profile
@ljaniszewski
ljaniszewski / DocDBAuthHeaderWithNode.js
Last active October 19, 2018 13:18 — forked from cmatskas/DocDBAuthHeaderWithNode.js
DocumentDB RestAPI AuthHeader
var crypto = require("crypto");
var moment = require("moment");
let masterKey = "<your documentDB read&write key>";
let dateInRfc7231Format = moment().utc().format("ddd, DD MMM YYYY HH:mm:ss");
let dateWithTimeZone = dateInRfc7231Format + " GMT";
console.debug(dateWithTimeZone);
// list all databases
//let result = getAuthorizationTokenUsingMasterKey("GET", "", "dbs", dateWithTimeZone, masterKey);