Skip to content

Commit

Permalink
Add global rules tutorial and fix image size script
Browse files Browse the repository at this point in the history
  • Loading branch information
255kb committed Oct 25, 2023
1 parent c2eb38b commit 5efb2f5
Show file tree
Hide file tree
Showing 29 changed files with 177 additions and 49 deletions.
2 changes: 1 addition & 1 deletion content/blog/celebrating-4000-github-stars.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Mockoon is still, after five years, an open-source tool built by volunteer maint

So, to continue working on this project, we recently started looking for sponsors. And we were excited to announce in July that Mockoon was chosen by AppWrite as the first sponsored open-source project in their [OSS Fund](https://dev.to/appwrite/appwrite-oss-fund-sponsors-mockoon-119k). AppWrite is now our first Platinum sponsor 💪

[![Appwrite logo{300x64}](/images/sponsors/appwrite.png)](https://appwrite.io/)
[![Appwrite logo{361x64}](/images/sponsors/appwrite.png)](https://appwrite.io/)

If you like our application, please consider sponsoring us too and join all the [Sponsors and Backers](https://github.com/mockoon/mockoon/blob/main/backers.md) who helped this project over time!

Expand Down
6 changes: 3 additions & 3 deletions content/blog/september-2023-news.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ We have released three new versions since the last June newsletter, as we have m

Thanks to the [response fallback mode](https://mockoon.com/docs/latest/route-responses/multiple-responses/#fallback-mode) introduced in [v4.1.0](https://mockoon.com/releases/4.1.0/), it is now possible to create wildcard routes containing global rules, such as validating the presence of an Authorization header or verifying that the request body contains a specific property. Head over to our new [Global routes with rules](https://mockoon.com/docs/latest/route-responses/global-routes-with-rules/) documentation section to learn how to create reusable responses and rules and apply them to all your routes.

![application screenshot with a wildcard route](/images/blog/september-2023-news/create-wildcard-route.png)
![application screenshot with a wildcard route{599x329}](/images/blog/september-2023-news/create-wildcard-route.png)

## 🎬 New GitHub Action

We have officially launched a [GitHub Action](https://github.com/marketplace/actions/mockoon-cli) for the CLI, allowing you to effortlessly run your mocks within your GitHub CI environment.

![screenshot of mockoon github action code](/images/blog/september-2023-news/mockoon-github-action-code-screenshot.png)
![screenshot of mockoon github action code{690x298}](/images/blog/september-2023-news/mockoon-github-action-code-screenshot.png)

No complex setup is required. Simply add the action to your workflow and provide a path to a local data file, or a URL, and you're good to go.

Expand All @@ -55,7 +55,7 @@ We have recently removed Google Analytics from our website as part of our commit

We have partnered with several other open-source projects that we admire and wish to support. Feel free to [explore them!](https://mockoon.com/oss-friends/)

![](/images/blog/september-2023-news/oss-friends.png)
![{1150x735}](/images/blog/september-2023-news/oss-friends.png)

## 🛠️ Custom services

Expand Down
2 changes: 1 addition & 1 deletion content/docs/latest/route-responses/dynamic-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ After creating [multiple responses](docs:route-responses/multiple-responses) for

You can define an unlimited number of rules for each route. At each request, Mockoon will assert each response's rules and serve the response which contains the first matching rule(s). The rules are interpreted in the order they are declared: `[rule OR|AND rule] OR [rule OR|AND rule]`, the brackets symbolizing each route response.

![Rules interpretation order{355x395}](/images/docs/shared/dynamic-rules-schema.png)
![Rules interpretation order{455x395}](/images/docs/shared/dynamic-rules-schema.png)

To add a new rule to a response, go to the route response's **Rules tab**, click on "Add rule" and fill the fields:

Expand Down
2 changes: 1 addition & 1 deletion content/docs/v1.22.0/route-responses/dynamic-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ After creating [multiple responses](docs:route-responses/multiple-responses) for

You can define an unlimited number of rules for each route. At each request, Mockoon will assert each response's rules and serve the response which contains the first matching rule(s). The rules are interpreted in the order they are declared: `[rule OR|AND rule] OR [rule OR|AND rule]`, the brackets symbolizing each route response.

![Rules interpretation order{355x395}](/images/docs/shared/dynamic-rules-schema.png)
![Rules interpretation order{455x395}](/images/docs/shared/dynamic-rules-schema.png)

To add a new rule to a response, go to the route response's **Rules tab**, click on "Add rule" and fill the fields:

Expand Down
2 changes: 1 addition & 1 deletion content/docs/v1.23.0/route-responses/dynamic-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ After creating [multiple responses](docs:route-responses/multiple-responses) for

You can define an unlimited number of rules for each route. At each request, Mockoon will assert each response's rules and serve the response which contains the first matching rule(s). The rules are interpreted in the order they are declared: `[rule OR|AND rule] OR [rule OR|AND rule]`, the brackets symbolizing each route response.

![Rules interpretation order{355x395}](/images/docs/shared/dynamic-rules-schema.png)
![Rules interpretation order{455x395}](/images/docs/shared/dynamic-rules-schema.png)

To add a new rule to a response, go to the route response's **Rules tab**, click on "Add rule" and fill the fields:

Expand Down
2 changes: 1 addition & 1 deletion content/docs/v3.0.0/route-responses/dynamic-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ After creating [multiple responses](docs:route-responses/multiple-responses) for

You can define an unlimited number of rules for each route. At each request, Mockoon will assert each response's rules and serve the response which contains the first matching rule(s). The rules are interpreted in the order they are declared: `[rule OR|AND rule] OR [rule OR|AND rule]`, the brackets symbolizing each route response.

![Rules interpretation order{355x395}](/images/docs/shared/dynamic-rules-schema.png)
![Rules interpretation order{455x395}](/images/docs/shared/dynamic-rules-schema.png)

To add a new rule to a response, go to the route response's **Rules tab**, click on "Add rule" and fill the fields:

Expand Down
2 changes: 1 addition & 1 deletion content/docs/v3.1.0/route-responses/dynamic-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ After creating [multiple responses](docs:route-responses/multiple-responses) for

You can define an unlimited number of rules for each route. At each request, Mockoon will assert each response's rules and serve the response which contains the first matching rule(s). The rules are interpreted in the order they are declared: `[rule OR|AND rule] OR [rule OR|AND rule]`, the brackets symbolizing each route response.

![Rules interpretation order{355x395}](/images/docs/shared/dynamic-rules-schema.png)
![Rules interpretation order{455x395}](/images/docs/shared/dynamic-rules-schema.png)

To add a new rule to a response, go to the route response's **Rules tab**, click on "Add rule" and fill the fields:

Expand Down
2 changes: 1 addition & 1 deletion content/docs/v4.0.0/route-responses/dynamic-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ After creating [multiple responses](docs:route-responses/multiple-responses) for

You can define an unlimited number of rules for each route. At each request, Mockoon will assert each response's rules and serve the response which contains the first matching rule(s). The rules are interpreted in the order they are declared: `[rule OR|AND rule] OR [rule OR|AND rule]`, the brackets symbolizing each route response.

![Rules interpretation order{355x395}](/images/docs/shared/dynamic-rules-schema.png)
![Rules interpretation order{455x395}](/images/docs/shared/dynamic-rules-schema.png)

To add a new rule to a response, go to the route response's **Rules tab**, click on "Add rule" and fill the fields:

Expand Down
2 changes: 1 addition & 1 deletion content/docs/v4.1.0/route-responses/dynamic-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ After creating [multiple responses](docs:route-responses/multiple-responses) for

You can define an unlimited number of rules for each route. At each request, Mockoon will assert each response's rules and serve the response which contains the first matching rule(s). The rules are interpreted in the order they are declared: `[rule OR|AND rule] OR [rule OR|AND rule]`, the brackets symbolizing each route response.

![Rules interpretation order{355x395}](/images/docs/shared/dynamic-rules-schema.png)
![Rules interpretation order{455x395}](/images/docs/shared/dynamic-rules-schema.png)

To add a new rule to a response, go to the route response's **Rules tab**, click on "Add rule" and fill the fields:

Expand Down
2 changes: 1 addition & 1 deletion content/old-releases/desktop/1.21.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Mockoon is an open-source project built by volunteer maintainers. If you like ou
We added a new feature called "Data buckets". It's a key-value store available in each environment. Each data bucket is persistent and generated when the server starts. Data buckets can be directly [linked to a route response](https://mockoon.com/docs/latest/data-buckets/using-data-buckets/#referencing-in-a-route-response) or using one of the two new helpers: [`data`](https://mockoon.com/docs/latest/templating/mockoon-helpers/#data) and [`dataRaw`](https://mockoon.com/docs/latest/templating/mockoon-helpers/#dataraw).
Read the [documentation](https://mockoon.com/docs/latest/data-buckets/overview/) to learn more.

![data buckets interface screenshot](/images/releases/desktop/1.21.0/data-buckets.png)
![data buckets interface screenshot{1202x678}](/images/releases/desktop/1.21.0/data-buckets.png)

This first step will make the development of CRUD and GraphQL routes easier.

Expand Down
2 changes: 1 addition & 1 deletion content/old-releases/desktop/1.21.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Mockoon is an open-source project built by volunteer maintainers. If you like ou
We added a new feature called "Data buckets". It's a key-value store available in each environment. Each data bucket is persistent and generated when the server starts. Data buckets can be directly [linked to a route response](https://mockoon.com/docs/latest/data-buckets/using-data-buckets/#referencing-in-a-route-response) or using one of the two new helpers: [`data`](https://mockoon.com/docs/latest/templating/mockoon-helpers/#data) and [`dataRaw`](https://mockoon.com/docs/latest/templating/mockoon-helpers/#dataraw).
Read the [documentation](https://mockoon.com/docs/latest/data-buckets/overview/) to learn more.

![data buckets interface screenshot](/images/releases/desktop/1.21.0/data-buckets.png)
![data buckets interface screenshot{1202x678}](/images/releases/desktop/1.21.0/data-buckets.png)

This first step will make the development of CRUD and GraphQL routes easier.

Expand Down
2 changes: 1 addition & 1 deletion content/old-releases/desktop/1.22.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Mockoon is an open-source project built by volunteer maintainers. If you like ou

You can now organize your routes into folders and sub-folders:

![routes organized in folders and sub-folders](/images/releases/desktop/1.22.0/routes-nested-folder.png)
![routes organized in folders and sub-folders{718x467}](/images/releases/desktop/1.22.0/routes-nested-folder.png)

This new feature allows users to better organize their routes and make their APIs more readable and easier to navigate, with a clearer hierarchy. During the development, we also reworked how the drag and drop and the filtering are handled, which should result in an overall better experience. Head over to our [folders documentation](https://mockoon.com/docs/latest/api-endpoints/folders/) to learn more about this feature.
(Issue [#97](https://github.com/mockoon/mockoon/issues/97))
Expand Down
12 changes: 6 additions & 6 deletions content/old-releases/desktop/1.23.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ Where Mockoon routes are independent and stateless, CRUD endpoints can generate

Head over to the [CRUD routes documentation](https://mockoon.com/docs/latest/api-endpoints/crud-routes/) to learn everything you need to make the most of them.

![crud route in the routes menu](/images/releases/desktop/1.23.0/crud-routes.png)
![crud route in the routes menu{829x352}](/images/releases/desktop/1.23.0/crud-routes.png)

## Default listening IP addresses

Mockoon desktop and CLI now listen by default to both IPv4 (0.0.0.0) and IPv6 (::) default addresses. You can also override the hostname in the desktop application in the environment settings tab:

![input field to override the hostname](/images/releases/desktop/1.23.0/custom-hostname-setting.png)
![input field to override the hostname{949x235}](/images/releases/desktop/1.23.0/custom-hostname-setting.png)

(Issue [#930](https://github.com/mockoon/mockoon/issues/930))

Expand Down Expand Up @@ -67,31 +67,31 @@ Mockoon can now create responses from OpenAPI `examples` during import. Consider

Mockoon will automatically create multiple responses from the schema and the examples:

![mockoon interface showing 3 responses with examples created after an openapi import](/images/releases/desktop/1.23.0/openapi-import-schema-examples.png)
![mockoon interface showing 3 responses with examples created after an openapi import{972x600}](/images/releases/desktop/1.23.0/openapi-import-schema-examples.png)

(Issue [#967](https://github.com/mockoon/mockoon/pull/967))

## WebDAV HTTP methods

Mockoon now supports WebDAV's HTTP methods for distributed authoring as specified in the RFC2518 Section 8:

![mockoon interface showing webdav specific http methods](/images/releases/desktop/1.23.0/webdav-http-methods.png)
![mockoon interface showing webdav specific http methods{374x433}](/images/releases/desktop/1.23.0/webdav-http-methods.png)

(Issue [#937](https://github.com/mockoon/mockoon/issues/937))

## Auto-start environments

We added a new setting to auto-start the environments when the application launches:

![checkbox to enable environments auto-start](/images/releases/desktop/1.23.0/environments-auto-start.png)
![checkbox to enable environments auto-start{546x88}](/images/releases/desktop/1.23.0/environments-auto-start.png)

(Issue [#121](https://github.com/mockoon/mockoon/issues/121))

## Improved logs interface

We improved the logs interface to clarify the purpose of the delete button:

![Logs delete button](/images/releases/desktop/1.23.0/environment-logs-delete-button.png)
![Logs delete button{910x235}](/images/releases/desktop/1.23.0/environment-logs-delete-button.png)

(Issue [#686](https://github.com/mockoon/mockoon/issues/686))

Expand Down
8 changes: 4 additions & 4 deletions content/releases/3.1.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Mockoon is an open-source project built by volunteer maintainers. If you like ou

We are happy to announce that Mockoon Pro plans are now available. The first feature available in this plan is the ability to [generate mock endpoints using our AI assistant](https://mockoon.com/ai-powered-api-mocking/) alongside access to dozens of [templates](https://mockoon.com/templates/). It is the perfect companion for quick prototyping and teaching API concepts!

![animation showing a prompt being entered and realistic JSON being generated](/images/releases/3.1.0/ai-generated-mock-api-endpoint.gif)
![animation showing a prompt being entered and realistic JSON being generated{766x605}](/images/releases/3.1.0/ai-generated-mock-api-endpoint.gif)

The Pro plan is available for solo developers and teams. The Team and Enterprise tiers also include priority support and a welcome training.

Expand All @@ -40,23 +40,23 @@ We will add more features to the Pro plan in the future. You can subscribe to ou

A new recording mode is available in the logs view. It allows you to automatically create endpoints from the entering requests and proxied responses ([documentation](https://mockoon.com/docs/latest/logging-and-recording/auto-mocking-and-recording/)).

![Enable recording mode by clicking on the record button in the logs view](/images/releases/3.1.0/logs-recording.png)
![Enable recording mode by clicking on the record button in the logs view{1075x186}](/images/releases/3.1.0/logs-recording.png)

(Issue [#722](https://github.com/mockoon/mockoon/issues/722))

### Status code shown in logs entries

The status code is now shown in the logs entries:

![screenshot showing logs entries with a badge](/images/releases/3.1.0/status-code-badge-logs-entries.png)
![screenshot showing logs entries with a badge{842x437}](/images/releases/3.1.0/status-code-badge-logs-entries.png)

(Issue [#1031](https://github.com/mockoon/mockoon/issues/1031))

### Zoom

You can now zoom in and out using the `Ctrl + +` and `Ctrl + -` shortcuts. The zoom can also be reset using `Ctrl 0`.

![screenshot showing the zoom shortcuts](/images/releases/3.1.0/zoom-shortcuts.png)
![screenshot showing the zoom shortcuts{599x202}](/images/releases/3.1.0/zoom-shortcuts.png)

### Misc

Expand Down
6 changes: 3 additions & 3 deletions content/releases/4.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ Finally, the new logging format automatically filters out credentials from the l

- A new setting is available to enable full transaction logging. (Issue [#1063](https://github.com/mockoon/mockoon/issues/1063))

![enable full transaction logging in the settings dialog](/images/releases/4.0.0/enable-full-transaction-logging.png)
![enable full transaction logging in the settings dialog{808x364}](/images/releases/4.0.0/enable-full-transaction-logging.png)

- A new context menu item is available to move an environment's data file to a new location without having to close and reopen it. (Issue [#1062](https://github.com/mockoon/mockoon/issues/1062))

![move environment file to a new folder](/images/releases/4.0.0/environment-file-move.png)
![move environment file to a new folder{523x291}](/images/releases/4.0.0/environment-file-move.png)

- The id property used to manipulate data in single resource routes (GET `/res/:id`, PUT `/res/:id`, etc.) in a CRUD endpoint can now be set to something else like "uuid", "custom_id", etc. (Issue [#1041](https://github.com/mockoon/mockoon/issues/1041))

![customize the crud id property](/images/releases/4.0.0/customize-crud-id-property-key.png)
![customize the crud id property{1495x360}](/images/releases/4.0.0/customize-crud-id-property-key.png)

- You can now search for routes in collapsed folders. (Issue [#960](https://github.com/mockoon/mockoon/issues/960))

Expand Down
4 changes: 2 additions & 2 deletions content/releases/4.1.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ Mockoon is an open-source project built by volunteer maintainers. If you like ou

A new response mode has been added. It allows you to fallback to the next route and ultimately the proxied server when no response rules match instead of serving the default response. Visit the [documentation](https://mockoon.com/docs/latest/route-responses/multiple-responses/#fallback-mode) to learn more. (Issues [#363](https://github.com/mockoon/mockoon/issues/363))

![enable fallback mode](/images/releases/4.1.0/enable-response-fallback-mode.png)
![enable fallback mode{979x174}](/images/releases/4.1.0/enable-response-fallback-mode.png)

## | Dynamic rules with templating

The templating helpers are now supported in the rule values letting you create dynamic rules. (Issue [#988](https://github.com/mockoon/mockoon/issues/988))

![screenshot showing a response rule with a template helper in the value field](/images/releases/4.1.0/template-helper-response-rule-value.png)
![screenshot showing a response rule with a template helper in the value field{1303x234}](/images/releases/4.1.0/template-helper-response-rule-value.png)

## | Changes to templating helpers

Expand Down
4 changes: 2 additions & 2 deletions content/releases/5.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ We are using the [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus) li

It is now possible to create routes that will match any HTTP method. You can now select "All methods" in the routes method dropdown:

![wildcard route on all methods](/images/releases/5.0.0/route-select-all-methods.png)
![wildcard route on all methods{562x207}](/images/releases/5.0.0/route-select-all-methods.png)

## | Global routes with rules

Expand All @@ -64,7 +64,7 @@ We also updated the desktop application's demo environment to showcase this new

- We added a link in the footer update notification to let you easily check the new version's changelog (will be visible for updates >v5.0.0):

![footer update notification](/images/releases/5.0.0/footer-update-notification.png)
![footer update notification{788x149}](/images/releases/5.0.0/footer-update-notification.png)

## | CLI

Expand Down
Loading

0 comments on commit 5efb2f5

Please sign in to comment.