FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    Different base resources for an environment

    Scheduled Pinned Locked Moved
    Q&A
    theme environments customization
    0
    2
    4.5k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • danD
      dan
      last edited by

      If I want to host my CSS and images on a different hostname for each environment, how can I do so?

      So for dev, I want all these to be pulled from dev.example.com. For prod from prod.example.com, and so on.

      What is the best way to do this?

      --
      FusionAuth - Auth for devs, built by devs.
      https://fusionauth.io

      1 Reply Last reply Reply Quote 0
      • danD
        dan
        last edited by

        The best way to do this is to put a value on the tenant.data object. From there you can access it in each theme.

        So, for the tenant in the dev environment, set tenant.data.assethost to dev.example.com. For the prod environment, set tenant.data.assethost to dev.example.com.

        Then, in your theme, you'd have something like this:

        <link rel="stylesheet" href="${tenant.data.assethost}/styles.css"/>
        

        The reason to use the tenant object is that it is available on every theme template.

        This does mean that your tenant configuration will differ slightly between environments. You can also replicate this field value between tenants if you are using multiple tenants.

        --
        FusionAuth - Auth for devs, built by devs.
        https://fusionauth.io

        1 Reply Last reply Reply Quote 0
        • First post
          Last post