Pregunta

I'm following a tutorial for google maps v3 where in the <head> they include:

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

I want to share my code on github but I don't want my API_KEY to be public. Is there something I can do with .gitignore to reference the above script but not share my api key?

¿Fue útil?

Solución

Maybe it's easier if you just don't use a key. It's an optional feature so Google can track your API usage for example if you need to purchase additional quota.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top