Forked from the node.js sample application for the Google Photos Library API.
Before you can run this sample, you must set up a Google Developers project and configure authentication credentials. Follow the get started guide to complete these steps:
- Set up a Google Developers Project and enable the Google Photos Library API.
- In your project, set up new OAuth credentials for a web server application. Set the authorized JavaScript origin to
http://127.0.0.1
and the authorized redirect URL tohttp://127.0.0.1:8080/auth/google/callback
if you are running the app locally. - The console will display your authentication credentials. Add the
Client ID
andClient secret
to the fileconfig.js
, replacing the placeholder values:
// The OAuth client ID from the Google Developers console.
config.oAuthClientID = 'ADD YOUR CLIENT ID';
// The OAuth client secret from the Google Developers console.
config.oAuthclientSecret = 'ADD YOUR CLIENT SECRET';
You are now ready to run the sample:
- Install dependencies: Run
npm ci
, - Start the app: Run
npm start
.
By default, the app will listen on port 8080
. Open a web browser and navigate to http://127.0.0.1:8080 to access the app.