Handling test and live environments

Options

We are working on a Software as a service platform in which we would want to create apis for other businesses to consume in the banking domain. Now for them to integrate these apis in their applications we want to give them two different environments, test and live. The users can generate their client_key and client_secret for these two environments separately and then consume the apis. The data source should be different for both of them while the api stack would be the same. How can we implement this in a way that when a request comes to our Xano server it routes it to the correct data source on the basis of the client_key (client keys would contain the keyword test or live as the suffix)?

Tagged:

Answers

  • lesa
    lesa Member, Administrator

    ADMIN

    Options

    Hi Aakash

    Here's a resource you can follow to implement this. I would recommend using the header approach based on your use case.

  • aakashrivastava
    Options

    Hello @lesa

    We did came across this approach of connecting to different data sources on the basis of the request header but this doesn't seem ideal as I'm assuming that we would have to then expect the integrators to pass in the data source header in every request they make to our Xano server which is a sensitive information.

    Is there any other workaround for this in which we can make the route to test and live data source on the basis of the client_key?

  • lesa
    lesa Member, Administrator

    ADMIN

    Options

    Hi Aakash

    At the moment we only have the 2 options but I do agree that it would be beneficial to have workarounds that are not limited to just the url parameter or header.

    Please submit this as a feature request at xano.nolt.io and share the link once done so others who are interested can also upvote the request.