【问题标题】:hide the google maps api key for github隐藏 github 的 google maps api 密钥
【发布时间】:2014-02-12 05:38:33
【问题描述】:

我正在关注谷歌地图 v3 的教程,其中包括 <head>

<script type="text/javascript"
      src="https://maps.googleapis.com/maps/api/js?key=API_KEY&sensor=SET_TO_TRUE_OR_FALSE">
</script>

我想在 github 上分享我的代码,但我不希望我的 API_KEY 公开。我可以用 .gitignore 做些什么来引用上述脚本但不共享我的 api 密钥?

【问题讨论】:

    标签: google-maps github gitignore api-key


    【解决方案1】:

    如果您不使用密钥,也许会更容易。这是一项可选功能,因此 Google 可以跟踪您的 API 使用情况,例如,如果您需要购买额外的配额。

    【讨论】:

    • 是的,如果没有必要没问题
    猜你喜欢
    • 2012-03-11
    • 2014-03-23
    • 1970-01-01
    • 2020-08-02
    • 2020-08-17
    • 2011-03-27
    • 2011-11-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多