Testing environment and production

Hello,
I am getting ready to publish our site soon.

I need to think through how to set up a testing environment.

What is the best practice for this on the WeWeb side?

I’ve thought about creating a variable called “is_test_enviornment”.

Then, inside all of our API endpoints for CRUD, set them if/then based on that variable.

I could then work on the site with the is_test_enviornment set to true, then change it to false, then publish.

Any thoughts/best practices here?

Thank you.

2 Likes

To be honest, we don’t have best practices for now (we’re working on the staging environment right now, that’s a big issue for our users).

Most of our users copy the app and change the URLs to the staging ones in the copy, but I assume what you’re doing would work too :wink:

1 Like

Thanks Quentin. I like the approach of the copy more. That removed any ability to accidentally hit the publish button by accident as well.

Do they then just copy/paste changes into the production environment, then publish?

Ah yeah I forgot about the new pricing. Send me your workspace ID by DM and we’ll give you 2 live apps :wink:

@Quentin is this still the best approach for handling a staging environment?

@Quentin I also need a staging environment too. Would it be possible to have two apps for my project but pricing remain the same?

@caffeinatedwes I think it still is atm :wink:

@tjmcdonough we’re currently working on a new pricing and the staging env, we’ll keep you posted!

2 Likes

@Quentin Thanks!

@kevinwasie, did you use Xano’s branching feature as well by chance?

@Quentin how does WeWeb’s native Xano integration handle branching? I’m guessing with the current integration that WeWeb always use the live branch. Is there any way to use a non-live branch in a project?

Here’s how I’m currently thinking through an ideal setup—

Live/production environment

  • My WeWeb app is live on a specific domain
  • WeWeb uses my live Xano API by default

Testing environment

  • I think I would need an additional custom domain so I can copy the live project, publish it to “dev.testing.mywebsite.com” (or something similar), and begin making edits and publishing those edits to dev.testing.mywebsite.com so I can test them in a “real” environment.
  • When I’m ready to go live with this version, I would need to remove the live WeWeb’s domain and add it to the new WeWeb app.
  • Ideally, there would be a setting on the WeWeb<>Xano integration (under Xano in the plugin settings) to configure WeWeb to work alongside Xano’s versioning logic. IE, I could select which version I would want to use, and if I selected one of my non-live branches (such as branch v2), WeWeb would add :v2 to all API endpoints

From what I can tell, everything above is possible except for the bolded “Ideally…” component, but I’d love to hear from someone on the WeWeb team to confirm (or suggest a different route).