Google API's are great but they were designed before the module partner of Javascript programing became popular. This starter fixes that handing Google login and library loading for you.
git clone https://github.com/rlancer/gapi-starter.git
cd gapi-starter
npm install
Create a file titled app_settings.json in the root directory.
{
"client_id": "Your apps client ID from the Google API console",
"libraries": [
{
"name": "compute",
"version": "v1"
},
{
"name": "drive",
"version": "v2"
},
{
"name": "gmail",
"version": "v1"
},
{
"name": "calendar",
"version": "v3"
},
{
"name": "all the other libs you wont to work with",
"version": "v3"
}
],
"scopes": [
"profile scope added automatically",
"https://www.googleapis.com/auth/compute.readonly",
"https://www.googleapis.com/auth/compute",
"https://www.googleapis.com/auth/cloud-platform"
]
}
webpack-dev-server --progress --colors --port 9030
In the Google API Console
Under Credentials, make sure that the project has the proper Javascript origin set for both production and development.