UNPKG

apigee-edge-js

Version:

nodejs library for the administration API for Apigee (Edge and X and hybrid).

40 lines (32 loc) 954 B
// test1.js // ------------------------------------------------------------------ // // created: Tue Jun 7 16:18:18 2022 // last saved: <2023-December-12 15:13:23> /* jshint esversion:9, node:true, strict:implied */ /* global process, console, Buffer */ const apigeejs = require("apigee-edge-js"), util = require("util"), apigee = apigeejs.apigee, common = apigeejs.utility; process.on("unhandledRejection", (r) => console.log("\n*** unhandled promise rejection: " + util.format(r)) ); if (!process.env.TOKEN) { throw new Error("must set TOKEN"); } let options = { org: "infinite-chain-292422", apigeex: true, token: process.env.TOKEN, verbosity: true }; apigee .connect(options) .then((org) => { common.logWrite("connected"); return org.proxies.get({}).then((items) => { console.log("proxies: " + JSON.stringify(items)); }); }) .catch((e) => console.log("while executing, error: " + util.format(e)));