18.4.8.6 Best Practices for Configuring BOSS REST Service Base URL
Learn about best practices fo configuring BOSS REST Service Base URL
When you build an APEX application, many developers use distinct development (DEV) and production (PROD) environments. When that application makes use of a REST Data Source, you will often want it to use a different REST endpoint URL in DEV than in PROD. This approach lets you test your application in DEV without disturbing PROD end users or PROD data. Oracle APEX’s Remote Server feature makes it easy to accommodate this usage pattern when working with REST Data Sources, including BOSS REST Data Sources.
When defining a REST Data Source, you provide the Endpoint URL. APEX manages this URL value as a two-part string. The leading part is the Base URL and it comes from a particular Remote Server definition. The trailing part of the Endpoint URL is the Service URL Path. APEX makes it easy to change the value of the Remote Server Base URL when you deploy your app to a different environment. The value of the Remote Server Base URL stays "sticky" to the target deployment environment so you can easily deploy updated version of your app from DEV to PROD and the Remote Server Base URL definition in PROD stays how you configured it for PROD.
Study the URLs of the REST endpoints you need to work with and determine how they need to change when switching between DEV and PROD environments. This lets you decide where to "split" the Endpoint URLs into a changeable Base URL part and the static Service URL Path that is the same in both environments. While using the Create REST Data Source Wizard, on the Remote Server step you can adjust the Remote Server and Service URL Path so the remote server’s Base URL encapsulates the leading half of the REST service’s endpoint URL that needs to change when deploying your application to another APEX instance. You can then adjust the Service URL Path to retain the trailing half of the service’s endpoint URL that will always stay the same across deployments. You can always adjust how a REST Data Source’s endpoint URL is split between base URL and service path URL at a later time.