170
Views
2
Comments
Solved
Setting Custom Domain to App in ODC
Question
Application Type
Reactive

Hi all,

We want to develop a new application on our ODC platform and use a new custom domain we've added.

I've quickly reviewed the documentation, but I couldn't find information on assigning domains to specific apps.

Currently, we have two custom domains:

  • dev.mypass.co.za (for our new application)
  • dev.zuzanigroup.com (for our current application)

Has anyone done this before and can provide some guidance?


2023-02-06 14-27-11
André Smit
Solution

@Joseph Marlin was very helpful and pointed me in the right direction. All credit goes to him.


There is currently no way to set a default application for a URL, so the app must be accessed using the AppName as part of the URL.

However, a workaround to ensure the correct custom URL is used for a particular app involves adding code to a shared component that all apps use, such as the LayoutTopMenu web block. I used the OnReady event to check the client's URL and compare it to a site property set for that app, indicating the desired URL. If the client accessed the app with a different URL, I can either throw an exception or redirect to the custom URL, depending on my preference.


1. Create a settings variable for the custom domain.

  • Can be a text variable and you can assign the default value to the custom domain of your choice.


2. Create a server action for redirecting the URL.

  • One input parameter (CurrentURL)
  • One output parameter (NewURL)
  • One variable (CustomDomain)
  • All text data types


3. Adjust logic OnReady (LayoutTopMenu)

  • New variable (CurrentURL) for OnReady


Hope this can help you if you stumble across a similar challenge.


2019-01-07 16-04-16
Siya
 
MVP

Currently, there is a provision to map an application to a domain in ODC. Let's hope that OutSystems will soon introduce this feature.

2023-02-06 14-27-11
André Smit
Solution

@Joseph Marlin was very helpful and pointed me in the right direction. All credit goes to him.


There is currently no way to set a default application for a URL, so the app must be accessed using the AppName as part of the URL.

However, a workaround to ensure the correct custom URL is used for a particular app involves adding code to a shared component that all apps use, such as the LayoutTopMenu web block. I used the OnReady event to check the client's URL and compare it to a site property set for that app, indicating the desired URL. If the client accessed the app with a different URL, I can either throw an exception or redirect to the custom URL, depending on my preference.


1. Create a settings variable for the custom domain.

  • Can be a text variable and you can assign the default value to the custom domain of your choice.


2. Create a server action for redirecting the URL.

  • One input parameter (CurrentURL)
  • One output parameter (NewURL)
  • One variable (CustomDomain)
  • All text data types


3. Adjust logic OnReady (LayoutTopMenu)

  • New variable (CurrentURL) for OnReady


Hope this can help you if you stumble across a similar challenge.


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.