Testing APIs across environments (dev, staging & prod) without going through deployment cycles
Tags: development, testing, deploymentpipelines
Published: 2023-06-30 05:39:35

---
title: Testing APIs across environments (dev, staging & prod) without going through deployment cycles
published: true
date: 2022-12-14 09:18:54 UTC
tags: development,testing,deploymentpipelines
canonical_url: https://requestly.com/blog/how-bureau-id-uses-requestly-to-toggle-staging-environment/
---

‍

[Bureau](https://bureau.id) provides end-to-end identity verification, compliance, and fraud prevention for new-age businesses. The Bureau dev & QA team uses Requestly for the testing of APIs (& core Javascript) across environments (dev, staging & prod) without going through deployment cycles.

‍Internally they have dev, staging, and production environments. This story explains how Requestly helps Bureau to develop & test different features across environments. Afsheen gives this testimonial on behalf of the entire Bureau team who have been using Requestly for some time.‍

### Challenge

Bureau has a common dev, staging, and production environment and they deploy to higher environments only after complete testing of features to ensure they ship high-quality & bug-free code. It is quite cumbersome to have everything running locally so developers often need to test their changes on the dev environment but that requires the deployment and also impacts other developers’ work. Similar challenges are faced by the QA team when they test a particular feature, they want to test on the staging environment. It would require deployment and reserving the Staging environment for testing that feature only.

![](https://cdn-images-1.medium.com/max/1012/0*Xqecm2qzEXksIT0O.png)

‍

### Solution

The Bureau team uses [Replace Rule to switch API endpoints](https://requestly.com/blog/replace-rule/) from one env to another. In fact, they also shared a blog post recently — [Switching environment is a costly affair. How we do it at Bureau using Requestly](https://tech.bureau.id/switching-environments-is-a-costly-affair-how-do-we-avoid-it-at-bureau-f3e778aa5932).

Here’s an example of their API endpoints:

- Dev environment: [https://api.checkout.dev.bureau.id](https://api.checkout.dev.bureau.id/)
- Staging: [https://api.checkout.stg.bureau.id](https://api.checkout.stg.bureau.id/)
- Production: [https://api.checkout.prd.bureau.id](https://api.checkout.prd.bureau.id/)
- Production: [https://api.checkout.prd.bureau.id](https://api.checkout.prd.bureau.id/)

So they configure Requestly Replace Rule like this

‍

**Rule Name** -> Dev to Stage

**Replace** api.checkout.dev.bureau.id

**With** api.checkout.stg.bureau.id

‍

Similarly, they also use Replace Rule to switch environments for their JS scripts hosted on CDNs. Here’s an example

‍

‍

They use [Requestly Mock Server](https://app.requestly.io/mock-server/my-mocks) when they need an API endpoint that doesn’t yet exist so they can develop when backend APIs are not ready.

‍

They use [Requestly Modify API Response](https://requestly.com/products/web-debugger/override-api-response/) feature to debug issues related to API responses directly on staging & production environments. This helps them avoid setting everything locally and reproducing the issues.

‍

They use [Requestly SharedList feature](https://requestly.com/blog/share-rules-with-other-users/) to collaborate and share Requestly configurations in the team easily. It is helpful to onboard new employees with Requestly as the rules are already pre-made.

![](https://cdn-images-1.medium.com/max/1002/0*KpZqTTDvAmbCt3aB.png)

_Originally published at_ [_https://requestly.com_](https://requestly.com/blog/how-bureau-id-uses-requestly-to-toggle-staging-environment/)_._

* * *