Publish your static files to Google Drive server and share
Inspired by Host webpages with Drive
$ sudo npm install -g gd-pages
-
From the Google Developers Console, select your project or create a new one.
-
Under "APIs & auth", click "Credentials".
-
Under "OAuth", click the "Create new client ID" button.
-
Select "Service account" as the application type, key type "P12 Key" and click "Create Client ID".
-
The key for your new service account should prompt for download automatically.
-
Go to "APIs" than enable "Drive API" and "Drive SDK"
Notice: was taken from https://github.com/extrabacon/google-oauth-jwt
It waits for 4 parameters:
- Service account -> Email address
- Path to pem file
- Path to folder for upload
- Folder name
- Sub folder (optional) can be useful for example: project-name/dev
$ gd-pages [email protected] ./Test-39c6f.p12 ./dist project
var gdPages = require('gd-pages');
gdPages('[email protected]', './Test-39c6f.p12', './dist', 'project');
MIT © ButuzGOL