A boilerplate for connecting to Google Drive, getting the file contents, then spitting it out with ArchieML.
1. Enable the Drive API
Use this wizard to create or select a project in the Google Developers Console and automatically enable the API.
- In the sidebar on the left, select Consent screen. Select an EMAIL ADDRESS, enter a PRODUCT NAME if not already set, and click the Save button.
- In the sidebar on the left, select APIs & auth and then Credentials.
- In the new tab that opens, click Create new Client ID.
- Select the application type Installed application, the installed application type Other, and click the Create Client ID button.
- Click the Download JSON button under your new client ID.
- Move this file to your working directory and rename it client_secret.json.
2. Authorize the app
You must run
node index.js once to authorize the app. After that, you don't need to authorize again because the information is stored in the file system.
- Browse to the provided URL in your web browser. If you are not already logged into your Google account, you will be prompted to log in. If you are logged into multiple Google accounts, you will be asked to select one account to use for the authorization.
- Click the Accept button.
- Copy the code you're given, paste it into the command-line prompt, and press Enter.
3. Run the app
You can choose to run the app from a web server using Express or from the terminal itself (perhaps useful for testing).
- Note: You must set the Google Doc "Share" settings to "anyone on the internet."
A) Using Express
- Go to
B) From Terminal
- Edit the file
index.jsto include your key in the variable
- Open Terminal