How to manage Repl after deploying to prod?

I have an app that doesn’t use DB, but rather API calls when in need to update a DB.
We finished testing, and i would like now to publish to prod. I will change the API url’s to the production ones, but how will i do in the future to keep adding features to this app?

Thanks
Jaime

The same way you are doing it now…rinse and repeat. You can tell it to have dev URL’s vs prod URL’s.

1 Like

thanks
i have currently a test url where i deploy for customers to see and test.
Now i will deploy to prod url. Can i remove the prod url in future deployments so i can show further improvements to the customer? will it void the prod url?

Hey Jaime, this is a common scenario when moving from testing to production, especially with API driven apps.

Once you’ve deployed the production version, a good approach is to create two separate branches or Repls:

  1. Production Repl: Stable, tested version pointing to your production API URLs. Only updated after proper testing.
  2. Development Repl (or branch): Where you keep experimenting, building, and testing new features. You point this to your test/staging APIs.

Then your flow could look like:

  • Make changes and test in the dev Repl
  • Once everything looks good, manually or programmatically sync the changes to the production Repl
  • Optionally, use .env files or environment variables for switching between API URLs dynamically, so you don’t need to hardcode them every time

For larger apps, you might even consider using GitHub + Replit’s deployments to manage versions more cleanly.

Let us know if you’d like a quick example setup, we’ve helped a few teams structure similar workflows for smoother rollout :rocket:

Hashlogics | Book a call

Duplicating the Repl to prod and dev seems a very good and easy to implement solution.
How can i use .env files to switch api urls dynamically?

In your Repl, create environment variables by clicking on the padlock icon :locked: in the left sidebar (next to “Files”). Add something like:

API_URL=https://staging.api.example.com

For production, you can switch this to:

API_URL=https://prod.api.example.com

In most environments (Node.js, Python, etc.), you can access the variable like this:

const apiUrl = process.env.API_URL;

or

import os
api_url = os.getenv("API_URL")

You can now set different values in each Repl:

  • In your dev Repl, keep the staging/test API URL.
  • In your prod Repl, set the same key (API_URL) but with the production endpoint.

This way, you don’t need to change the code at all just the environment variable behind the scenes.

Feel free to book a quick call if you’re planning to scale or automate more of this flow from the given calendly link previously!