Skip to content

Instantly share code, notes, and snippets.

@grant
Last active July 20, 2019 01:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grant/83abfda1d69131c513757716c74aa251 to your computer and use it in GitHub Desktop.
Save grant/83abfda1d69131c513757716c74aa251 to your computer and use it in GitHub Desktop.
GCF Debugging VSC List Google APIs
const {google} = require('googleapis');
/**
* Returns a list of Google APIs and their descriptions.
* @param {Express.Request} req The API request.
* @param {Express.Response} res The API response.
*/
exports.listGoogleAPIs = async (req, res) => {
// Call the API
const apis = await google.discovery('v1').apis.list();
// Build the response
const jsonResponse = {};
apis.data.items.map((api) => {
jsonResponse[api.id] = api.description;
});
// Sent the response
res.send(jsonResponse);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment