This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require("fs") | |
var ssl_options = { | |
key: fs.readFileSync('privatekey.pem'), | |
cert: fs.readFileSync('certificate.pem') | |
}; | |
var port = process.env.PORT || 3000; | |
var express = require('express'); | |
var ejs = require('ejs'); | |
var passport = require('passport') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This requires a google developers console project. That UI changes regularly and I found it hard to learn, but at the time I'm creating this, the steps are: | |
// - At the top-right, select or create a new project (can't give step-by-step details here) | |
// - Visit https://console.developers.google.com/apis/api/drive/overview | |
// - Enable API with your options (not sure they matter much, but API must be enabled) | |
// - Visit https://console.developers.google.com/permissions/serviceaccounts | |
// - Create a new service account if you don't already have one or don't have one you want to use for these API calls. Select the "Furnish new private key" option and the JSON format along with "Enable Google Apps Domain-wide Delegation". | |
// - Save provided JSON in a SECURE location (don't include in your source code and ensure it's ignored by GIT) | |
// You can generate new keys and/or revoke this one at https://console.developers.google.com/apis/credentials | |