Re: [flexcoders] Strategies for switching between testing and deployment addresses
We keep out URL's in an external XML file which is deployed on different environments. When app loads make a call to the Servlet and gets the URL's. The Servlet returns the configuration according to the environment that it is deployed on. HTH, C From: Nick Middleweek To: flexcoders@yahoogroups.com Sent: Thu, February 25, 2010 2:32:28 PM Subject: Re: [flexcoders] Strategies for switching between testing and deployment addresses Hey David, If you have a local DNS you could setup a subdomain for the production IP and edit your windows hosts file to override it to point locally... Tracy mentioned FlashVars, that's a real easy way. You've help me enough in the world of 4D so I'll ping something over if you need it... Cheers, Nick On 22 February 2010 02:00, David Adams wrote: > > > > > > > > > > > > > > > > >> > >> > >I've been writing some small programs that use HTTPService calls to >>fetch data from a back-end. During testing, I'm using 127.0.0.1 or an >>IP address on my subnet. When I deploy, I update the IP address in >>service definitions to the right external address and build the app. >>Or at least I mean to. It's all too easy to accidentally change the >>addresses for internal testing and then forget to switch them back >>before building. > >>Is there a best practice or simple strategy for putting the IP address >>somewhere outside of the source code that it can easily be edited >>without a rebuild? > >>Thanks for any advice. > > >
Re: [flexcoders] Strategies for switching between testing and deployment addresses
Hey David, If you have a local DNS you could setup a subdomain for the production IP and edit your windows hosts file to override it to point locally... Tracy mentioned FlashVars, that's a real easy way. You've help me enough in the world of 4D so I'll ping something over if you need it... Cheers, Nick On 22 February 2010 02:00, David Adams wrote: > > > I've been writing some small programs that use HTTPService calls to > fetch data from a back-end. During testing, I'm using 127.0.0.1 or an > IP address on my subnet. When I deploy, I update the IP address in > service definitions to the right external address and build the app. > Or at least I mean to. It's all too easy to accidentally change the > addresses for internal testing and then forget to switch them back > before building. > > Is there a best practice or simple strategy for putting the IP address > somewhere outside of the source code that it can easily be edited > without a rebuild? > > Thanks for any advice. > >
Re: [flexcoders] Strategies for switching between testing and deployment addresses
I'm too new at Flex to do anything fancy like reading files from the O/S file system, so I use the Project compile option. -locale en_US -define=CONFIG::debug,true Then I have me some constants: public static const DEBUGMODE:Boolean = CONFIG::debug; public static const DEBUG_BASEURL:String = "http://localhost/foo/"; public static const RELEASE_BASEURL:String = "http://www.somedomain.com/foo";; And then in my wrapper for the HTTPService: if ( SearchConstants.DEBUGMODE) { baseURL = SearchConstants.DEBUG_BASEURL ; }else{ baseURL= SearchConstants.RELEASE_BASEURL ; } All you have to do is change the compiler settings to "debug, false" and -- voilĂ -- or wa-la if you like that better. There's still the "forgetting to change the compiler options" issue, but it's probably a good habit to examine the Compiler options before each compile, and this approach inculcates a good habit. Take this with a grain of salt; I'm new to Flex; my expertise, if I have any at all, is not in Flex programming. Regards Tim Romano On 2/21/2010 8:00 PM, David Adams wrote: I've been writing some small programs that use HTTPService calls to fetch data from a back-end. During testing, I'm using 127.0.0.1 or an IP address on my subnet. When I deploy, I update the IP address in service definitions to the right external address and build the app. Or at least I mean to. It's all too easy to accidentally change the addresses for internal testing and then forget to switch them back before building. Is there a best practice or simple strategy for putting the IP address somewhere outside of the source code that it can easily be edited without a rebuild? Thanks for any advice. __
RE: [flexcoders] Strategies for switching between testing and deployment addresses
Or pass the IP address in via flashvars from the wrapper. You just need one wrapper for production and one for development. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Peeyush Tuli Sent: Monday, February 22, 2010 6:47 AM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Strategies for switching between testing and deployment addresses you can always read the ip address from an xml file at application startup and bind your service to it.. On Mon, Feb 22, 2010 at 6:30 AM, David Adams mailto:dpad...@gmail.com> com> wrote: I've been writing some small programs that use HTTPService calls to fetch data from a back-end. During testing, I'm using 127.0.0.1 or an IP address on my subnet. When I deploy, I update the IP address in service definitions to the right external address and build the app. Or at least I mean to. It's all too easy to accidentally change the addresses for internal testing and then forget to switch them back before building. Is there a best practice or simple strategy for putting the IP address somewhere outside of the source code that it can easily be edited without a rebuild? Thanks for any advice.
Re: [flexcoders] Strategies for switching between testing and deployment addresses
you can always read the ip address from an xml file at application startup and bind your service to it.. On Mon, Feb 22, 2010 at 6:30 AM, David Adams wrote: > > > I've been writing some small programs that use HTTPService calls to > fetch data from a back-end. During testing, I'm using 127.0.0.1 or an > IP address on my subnet. When I deploy, I update the IP address in > service definitions to the right external address and build the app. > Or at least I mean to. It's all too easy to accidentally change the > addresses for internal testing and then forget to switch them back > before building. > > Is there a best practice or simple strategy for putting the IP address > somewhere outside of the source code that it can easily be edited > without a rebuild? > > Thanks for any advice. > >