Giter Club home page Giter Club logo

heroku_gdrive_cdn's Introduction

Heroku CDN

This example uses the Google Drive SDK, Heroku and mongolab.

In order to run this example app, you'll need to set up a Google Drive SDK and deploy the app to a public server. Below we outline how to do so using free accounts from Heroku and MongoLabs.

Set up Heroku

We assume you're familiar with Git and have it installed.

  1. Visit http://www.heroku.com and sign up.

  2. Download the Heroku command line toolbelt from http://toolbelt.herokuapp.com/

  3. From your command line, type heroku login and enter your account details.

  4. Change to the server-side subdirectory of this example.

  5. Set up a git repository:

    $ git init

  6. Create a new app on Heroku:

    heroku create --stack cedar

Note the URL of your live app.

Set up Google Drive API

  1. Visit code.google.com/apis/console and create new project.
  2. On API section turn on 'Drive API' and 'Drive SDK'
  3. On 'Credentials' section create new client ID (web application)
  4. 'Redirect URI' should be <URL of your live app>/auth
  5. Download JSON and put this file to directory of this example (rename this file to 'secrets.json')

Set up MongoDB

  1. Visit https://mongolab.com and sign up.

  2. In the 'Databases' section, click 'Add'.

  3. Select the 'Free' plan on Amazon EC2, pick a database name, username and password.

  4. Click on your new database and note the connection URL. It should look something like this:

    mongodb://:@ds029807.mongolab.com:29807/

  5. Copy this URL to MONGO_CONNECTION_STRING variable in drive.py file

Build and Deploy your app

  1. Run the following git commands:

    $ git add . $ git commit -m "Initial commit" $ git push heroku master

  2. Auth you Google Drive account on <your live Heroku URL>/auth

Check your app

You can upload file to <your live Heroku URL>/upload, in responce server return live file URL.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.