Skip to content

Instantly share code, notes, and snippets.

@grant grant/index.js
Last active Jul 20, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.