Reputation: 103
In paw 3.0, I can create more than one paw project and each of which can have their own Environment. But how can I take advantage of it? One project of mine corresponding to one project in paw? or corresponding to the same project in paw but as another folder?
And can I duplicate my env from one paw project to another?
Upvotes: 2
Views: 99
Reputation: 5969
The way I use it is that each service is in its own file. Then I set up environment variables to reflect the environments I want to run on.
For example, I'm writing an API called MyAPI. MyAPI has multiple stages it can be running on.
So I setup server hostname/address for each environment separately within each environment. On top of that, I find myself wanting to know the result from specific machine within the same High Availability cluster to investigate anomalies.
There's also specific set of configuration in form of headers or payloads that we sent to MyAPI. For example, this can be user ID for testing behavior when different type of users requesting that endpoint (Requesting user profile as myself/logged-in-user/logged-out-user). This configs are in the different group than the one for server environment so I can switch the two freely.
It's also possible to make some data in the body as environment variable. However, I find myself wanting the name for each request explicit so I can skim quickly when looking for something or when sending multiple requests at once.
I only use folder to group similar endpoints together. For example, authentication folder, search folder, admin folder. This would varies depend on what you're working on.
If you are working in a micro-services environment, I find it best to separate each service into it's own file so it's easier to lookup/share to the team. This way you can separate sensitive endpoint from the one that should be available to everyone.
As for the duplicating environment, I have yet to find out how to do it. I did it once by manipulating the paw file itself but it wasn't pretty.
Upvotes: 2