sharedstreets
Version:
SharedStreets, a 'digital commons' for the street
29 lines (28 loc) • 1.09 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const https_1 = __importDefault(require("https"));
const fs_1 = __importDefault(require("fs"));
const SUBSCRIPTION_KEY = '95529f3eaa3b41eeb31edb01d38ac5a4';
https_1.default.get({
hostname: 'fordkerbhack.azure-api.net',
path: '/features?viewport=51.536393751918915,-0.1412890195847183,51.5397303909963,-0.13700821399694973',
headers: { 'Ocp-Apim-Subscription-Key': SUBSCRIPTION_KEY },
}, res => {
let body = '';
res.on('data', part => body += part);
res.on('end', () => {
for (var header in res.headers) {
if (header.startsWith("bingapis-") || header.startsWith("x-msedge-")) {
console.log(header + ": " + res.headers[header]);
}
}
fs_1.default.writeFileSync('ford.json', body);
});
res.on('error', e => {
console.log('Error: ' + e.message);
throw e;
});
});