Skip to content

Commit c598567

Browse files
author
heysep
committed
Remove google maps API key from source code
1 parent 88d6aec commit c598567

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ node_modules
22
.DS_Store
33
client/public/peer.js
44
client/public/temp.peer.js
5+
client/public/apiKeys.js
56
# Ignore bundled webpack modules #
67
client/public/webpack.min.js
78
client/public/webpack.min.js.map

client/public/apiKeys.example.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Fill out your API Keys below for each service.
2+
// Rename this file to apiKeys.js
3+
window.peerKey = 'hfskdhfkahsfkhsdkf';
4+
window.googleApiKey = 'ajksdfhkahfdkhsdkfjhkshf';

client/public/index.html

+5-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@
88
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.6.0/grids-responsive-min.css">
99
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.6.0/base-min.css">
1010
<script src="http://cdn.peerjs.com/0.3/peer.min.js"></script>
11-
<script src="peer.js"></script>
12-
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAtGXLK72mst-2nTDk2iR9Kwjzt6aL47jo"></script>
11+
<script src="apiKeys.js"></script>
12+
<script type="text/javascript">
13+
var apiSrc = 'https://maps.googleapis.com/maps/api/js?key=' + window.googleApiKey;
14+
document.write('<script type="text/javascript" src="' + apiSrc + '"></scr' + 'ipt>');
15+
</script>
1316
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-rc1/jquery.min.js"></script>
1417
</head>
1518
<body>

0 commit comments

Comments
 (0)