url:
    proxyhandler/github/search/users:
        pattern: /$YAMLURL/github/(.*)
        handler: ProxyHandler
        kwargs:
            url: https://api.github.com/{0}
            request_headers:
                User-Agent: true

    proxyhandler/google:
        pattern: /$YAMLURL/google/(.*)
        handler: ProxyHandler
        kwargs:
            url: https://www.googleapis.com/{0}
            request_headers:
                User-Agent: true
                Authorization: 'Bearer {handler.session[google_access_token]}'

    proxyhandler/googlecontacts:
        pattern: /$YAMLURL/googlecontacts/(.*)
        handler: ProxyHandler
        kwargs:
            url: https://www.google.com/m8/feeds/contacts/{0}
            default:
              alt: json
            request_headers:
                Authorization: 'Bearer {handler.session[google_access_token]}'

    proxyhandler/googletranslate:
        pattern: /$YAMLURL/googletranslate
        handler: ProxyHandler
        kwargs:
            url: https://translation.googleapis.com/language/translate/v2
            auth: true
            default:
              # https://cloud.google.com/translate/docs/quickstart
              key: $GOOGLE_API_KEY

    proxyhandler/googlesearch:
        pattern: /$YAMLURL/googlesearch
        handler: ProxyHandler
        kwargs:
            url: https://www.googleapis.com/customsearch/v1
            auth: true
            default:
              key: $GOOGLE_API_KEY
              # CSE created by s.anand@gramener.com
              # https://cse.google.com/cse/setup/basic?cx=010282404438907579631%3Aedrnyb3axxi
              cx: '010282404438907579631:edrnyb3axxi'

    proxyhandler/googlelanguage:
        pattern: /$YAMLURL/googlelanguage/(.*)
        handler: ProxyHandler
        kwargs:
            url: https://language.googleapis.com/{0}
            method: POST
            xsrf_cookies: false           # Only for testing
            request_headers:
              Content-Type: application/json
            default:
              key: $GOOGLE_API_KEY

    proxyhandler/gramener.com:
        pattern: /$YAMLURL/(demo|uistatic|node_modules|bowerlib)/(.*)
        handler: ProxyHandler
        kwargs:
            url: https://gramener.com/{0}/{1}
            auth: true
        cache:
            expiry: {duration: 300}

    proxyhandler/facebook:
        pattern: /$YAMLURL/facebook/(.*)
        handler: ProxyHandler
        kwargs:
            url: https://graph.facebook.com/{0}
            default:
                access_token: '{handler.session[user][access_token]}'
