Skip to content

Commit 78473e9

Browse files
committed
fix os.getenv() at cloud
1 parent dbc0988 commit 78473e9

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

PageSpeedInsights/main.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/usr/local/bin/python3
22
# -*- coding: utf-8 -*-
33
'''PageSpeed Insights + Google Cloud Functions'''
4-
4+
import os
55
from googleapiclient.discovery import build
66

77
# Access Token, generated from GCP Console Credentials page.
8-
API_KEY = ''
8+
API_KEY = os.getenv('GCP_API_KEY')
99

1010
# For local development, setup http proxy as needed.
1111
HTTP = None
@@ -41,7 +41,4 @@ def run(request):
4141
proxy_info = httplib2.ProxyInfo(httplib2.socks.PROXY_TYPE_SOCKS5, '127.0.0.1', 1086)
4242
)
4343

44-
import os
45-
API_KEY = os.getenv('GCP_API_KEY')
46-
4744
run(_request)

0 commit comments

Comments
 (0)