No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Adding API URL to process.env for three different situations

    CLI
    2
    3
    1189
    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.
    • T
      taylorg last edited by

      Hello!

      I’m new to Quasar, and I’m trying to add our API URLs to process.env through quasar.conf.js. I have been successfully able to configure the API for development and production environments by following this guide: https://quasar.dev/quasar-cli/cli-documentation/handling-process-env

      The issue is that I need to make the Quasar app mimic our backend in terms of the possible environments. Our app can run in three separate environments, local on the developer’s machine, on our dev server, and on our production server. Each one of these situations requires a different API URL. On the local machine, Quasar is run using ‘quasar dev’, but on both the dev and production servers, we run a ‘quasar build’ before deploying.

      Is there an easy way to set this up? I’m stuck on how I can differentiate between the dev and production servers when in quasar.conf.js, and thus set the correct value for the API URL. Any help would be much appreciated.

      1 Reply Last reply Reply Quote 0
      • metalsadman
        metalsadman last edited by

        @taylorg see app extensions qenv / dotenv https://quasar.dev/app-extensions/discover#Project-Rigging

        T 1 Reply Last reply Reply Quote 0
        • T
          taylorg @metalsadman last edited by

          @metalsadman Looks like just what I need, thank you! 🙂

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