Archived topic โ some details may be out of date.
Mock servers built from saved collection examples are still supported. Postman now also has code-based mocks: JavaScript request handlers plus aconfig.yaml, stored as files in your Git repository, which you can run locally or deploy. Create one in the app, or use the Postman CLI to generate one from an OpenAPI spec, collection or dataset (postman mock generate) and run it (postman mock run). See About mocks and Create a mock.
Working with an AI coding agent? The Postman plugin can build and run mocks for you.
For current help, see the Postman docs, try the free Postman tools (no account needed), or join us on Discord.
Hi guys,
Iโve searched for the answer for some time now and I failed to find anything.
Iโm testing out the mock servers and I can not figure out how to make the mock server to work with variable URLs.
I have an API endpoint of โ/order/initalize/[orderID]โ. The โ[orderID]โ part is variable and fits the ([A-Z0-9]{8}) regex;
It does not have to be such a specific pattern basically I would like the mock server to return the same example response for any call to โ/order/initalize/[whatever_string]โ or โ/order/initalize/*โ if you fancy.
Is it possible?
Thanks,
Jakub