How do I avoid hard-coding all my HTTPService URLs?
The reason I'm asking is, this app is going to run on different
servers with different IP addresses, and I need a way to get the app
to know what IP address its server is. For example, in the office
it's going to be running on the intranet at 192.168.1.254. But it'll
also be running on the web-server at a completely different address,
for people to use online (from home, for example). I can't hard-code
192.168.1.254 into all my HTTPService calls, because that would break
the app on the web-server.
So how do I do this? I was thinking about using an .XML file kind of
like an .INI file, where the app would read it at startup and get the
correct address to send HTTPService calls to, but the URL of that
.XML file would have to be hard-coded anyway, right? So it's kind of
a catch-22 situation, unless I'm missing something. Plus it would
require someone to edit that .XML file to put the correct IP address
in there, which is OK if it's the only way to do it, but seems kind
of primitive.
There should be an easy way (I would think) for the app to know what
it's base URL is, so I can simply put that into a global variable,
and then use the variable in all my HTTPService URLs -- so it'd just
work automatically no matter which server it's running on. But I
can't figure out how to do that. If anyone knows, I'd greatly
appreciate your telling me.
Thanks for any help you can give,
Laurence MacNeill
Mableton, Georgia, USA
-------------------------------------------------------------
To unsubscribe from this list, simply email the list with unsubscribe in the
subject line
For more info, see http://www.affug.com
Archive @ http://www.mail-archive.com/discussion%40affug.com/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------