Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for configuring mock/proxy behavior via the CLI #1024

Open
m-roberts opened this issue Apr 27, 2023 · 3 comments
Open

Add support for configuring mock/proxy behavior via the CLI #1024

m-roberts opened this issue Apr 27, 2023 · 3 comments
Labels
feature New feature request good first issue Good for newcomers

Comments

@m-roberts
Copy link
Contributor

m-roberts commented Apr 27, 2023

It would be great if it were possible to use a single mock server definition/specification (i.e. JSON file) for various different development patterns.

For example:

  • use as defined in file
  • override mode to be fully mocking (i.e. disable "proxy mode", keep routes enabled/disabled)
  • override mode to be partial mocking (i.e. enable "proxy mode", keep routes enabled/disabled)
  • override mode to be no mocking (i.e. enable "proxy mode", disable all routes) - meaning pure passthrough

This means that a simple app config can handle "run as in production", "run in isolation" (failing on undefined tests) and partial mocking (allow for easy addition of missing mocks).

This allows a developer to easily replicate the behaviour of an app in production, run a test suite or develop a new integration/e2e test without ever needing to change the hostname of the server endpoint.

This ability to control its proxy behavior at runtime adds a significant amount of value to using Mockoon as an easy-to-use mock/proxy server for rapid application and test development.

@m-roberts m-roberts changed the title Add support for overriding proxy enable/disable via the CLI Add support for configuring proxy behavior via the CLI Apr 27, 2023
@m-roberts m-roberts changed the title Add support for configuring proxy behavior via the CLI Add support for configuring mock/proxy behavior via the CLI Apr 27, 2023
@255kb 255kb added the feature New feature request label Jul 21, 2023
@255kb 255kb added the good first issue Good for newcomers label Apr 8, 2024
@aaron-junot
Copy link

@255kb The mockoon docs say that the CLI is supposed to support proxy mode, but I can't find documentation on how to enable it, and nothing in the repo makes it clear how to use proxy mode.

Screenshot 2024-05-21 at 5 03 10 PM

Can you please shed some light on the timeline for adding this feature?

@255kb
Copy link
Member

255kb commented May 22, 2024

@aaron-junot The CLI is not a standalone app. It is designed to run Mockoon data files created using the desktop app. All the features you can activate in the desktop app are supported by the CLI, this is the case for the proxy.
The CLI has some flags to override various configuration at runtime but not for the proxy yet.

@aaron-junot
Copy link

@255kb I looked at the docs again, I was using the wrong verbiage. I don't think this issue is actually relevant to what I wanted to do. I wanted to be able to record requests via the CLI.

For reference, the use case is that we have mocks, but the third party API that we're mocking has a breaking change and now our mocks must be re-recorded. We want to be able to re-record these in CI and then open a PR with the change to our JSON mocks repo.

Should I open a separate GitHub issue to discuss this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants