0

I'm working on a project that uses the Google Maps JavaScript API v3 to render directions on an integrated map.

The website it built with Jekyll and I run the server using the following command:

jekyll serve --host 192.168.2.7

The given IP address is the IP Address of the system running the server.

The reason I made it listen to that IP Address is because I want to test the application on my mobile devices, following this answer

In the API Console I whitelisted 192.168.*, so that any local connection can use the API.

However, when I go to that IP Address on my phone or computer, the API says the application is not authorized despite me having whitelisted it.

What am I doing wrong here and how can I solve it?

Community
  • 1
  • 1
MisterBla
  • 2,355
  • 1
  • 18
  • 29
  • Can you set up your network to use hostnames instead of IP addresses? – geocodezip Dec 30 '14 at 19:09
  • @geocodezip I tried to connect to the hostname of the server (which is my macbook), but I get a 404 on my phone using `http://macbook-richard.local:4000` – MisterBla Dec 30 '14 at 19:11
  • Probably isn't publicly available. It would need to be to get to it from your phone in all likelihood. It would have to be defined in a nameserver that is used by your phone (or locally on the phone). – geocodezip Dec 30 '14 at 19:12
  • @geocodezip I have never worked with hostnames before and I don't understand how to set it up. Do I have to use do something with DNS to do that? – MisterBla Dec 30 '14 at 19:21
  • Can't help you with that (and this is not the correct forum for that question). – geocodezip Dec 30 '14 at 19:51
  • @geocodezip I assume that's a question for Superuser. – MisterBla Dec 30 '14 at 19:55

2 Answers2

0

192.168.2.7 is a private IP address and is not publicly accessible. To use that you will probably need to get a license.

geocodezip
  • 158,664
  • 13
  • 220
  • 245
0

Jekyll serve

The --hostname flag doesn't exist. Use --host 192.168.2.7 or host: 192.168.2.7 in _config.yml. Target address will then be 192.168.2.7:4000 as 4000 is the default listening port for Jekyll webrick server.

Google API withelist

It's not necessary to white list domain, as with no domain white listed you have Any referer allowed

Google authorization

Verify that you've set your API key to something else than https://maps.googleapis.com/maps/api/js?key=API_KEY you are supposed to have something like this : https://maps.googleapis.com/maps/api/js?key=AIzaSytitittototoX7RhHn-drLRRYututu7eX2hVo

If you still have problems, you can give a repository url to have it fixed quicker. Happy Jekyll !

David Jacquel
  • 51,670
  • 6
  • 121
  • 147
  • Oops! Excuse me, I wrote it wrong there. I did use `--host` (let me change that). And if I understand correct of what you're saying, if no referers are specified, it's an empty blacklist? (I just checked it, you're right. It seemed a bit counter-intuitive to me) – MisterBla Dec 30 '14 at 19:54