dpd-gapi is a custom resource for deployd, an open source platform for building APIs. This custom resource leverages the Google APIs Node.js Client to expose Google APIs to deployd.
This is an example installation which enables requests to be executed against the Drive API of a Google account in deployd.
dpd create my-app
cd my-app
git clone https://github.com/bricemason/dpd-gapi.git
npm install dpd-gapi
dpd
- Browse to http://localhost:2403/dashboard
- Add a Google API Resource named /gapi
- Log in to your Google Developer Console account
- Create a new project. Under APIs & auth > Credentials create a new Client ID of type Web application
- Add http://localhost:2403 as an authorized JavaScript origin
- Add http://localhost:2403/gapi/auth/v1/oauth2callback as an authorized redirect URI
- Enable the Drive API for your project
- In your deployd dashboard, enter your Google project client ID, client secret, and the auth scope of https://www.googleapis.com/auth/drive
- Check the allowAnonymous checkbox if you want the resource open to all users
- Click Save
- Navigate to http://localhost:2403/gapi/auth/v1/init/
- Click Accept at the Google authorization screen
- Installation is complete. You can now issue requests against your deployd Google API. Test your installation by navigating to http://localhost:2403/gapi/drive/v2/about/get