I have google map web application on rails.
google map needs API key that depends on server address.
ex) example.com:3000 and example.com:4000 need different API key
I have API key for several addresses in database
example.com:3000 [some key]
example.com:4000 [some key]
localhost:3000 [some key]
192.168.0.17:3000 [some key]
I want to select proper key based on server address when server start up
Now I am manually changing API keys everytime I need to do.
#1 Is there any way to get server address (rails server itself)?
#2 Can this work be done when server startup? not every session?
Thank you
sean