diff --git a/components/download-section.tsx b/components/download-section.tsx index 40e97d60..5027e172 100644 --- a/components/download-section.tsx +++ b/components/download-section.tsx @@ -137,10 +137,13 @@ const DownloadSection: FunctionComponent<{ version: string }> = function ({
-
+
+ postDownload('linux')} > @@ -152,7 +155,7 @@ const DownloadSection: FunctionComponent<{ version: string }> = function ({ postDownload('linux')} > @@ -164,7 +167,7 @@ const DownloadSection: FunctionComponent<{ version: string }> = function ({ postDownload('linux')} > @@ -174,7 +177,35 @@ const DownloadSection: FunctionComponent<{ version: string }> = function ({ AppImage
-
(x86 only)
+
+ + postDownload('linux')} + > + + + + deb + + + postDownload('linux')} + > + + + + AppImage + +
+
or
diff --git a/components/footer.tsx b/components/footer.tsx index 0474ac96..17341de3 100644 --- a/components/footer.tsx +++ b/components/footer.tsx @@ -136,7 +136,7 @@ const Footer: FunctionComponent<{
  • {/* Do not use , as routes with a dot inside get rewritten without trailing slash */} - + Releases
  • diff --git a/components/nav.tsx b/components/nav.tsx index 7ed094e6..64c3954a 100644 --- a/components/nav.tsx +++ b/components/nav.tsx @@ -261,7 +261,7 @@ const Nav: FunctionComponent = function () { Blog Your path can be more complex, and contains parameters or multiple sections. Remember that this will be the "prefix" of the different endpoints (see below). @@ -30,7 +30,7 @@ Then, set its path, usually a [resource name](/articles/api-guide-rest-api-compo After creating a CRUD endpoint, you need to link it to a data bucket: -![Link a data bucket to a CRUD route{1495x334}](docs-img:link-data-bucket-crud-route.png) +![Link a data bucket to a CRUD route{1264x334}](docs-img:link-data-bucket-crud-route.png) > Head over to our [data buckets](docs:data-buckets/overview) documentation to learn how to create a new data bucket. @@ -80,7 +80,7 @@ Mockoon will automatically translate a CRUD endpoint to multiple routes allowing By default, CRUD endpoints will use the `id` property to identify objects in an array in all the routes manipulating a single resource (e.g. GET `/resource/:id`). However, you can change this property to anything you want, like `uuid`, `custom_id`, etc: -![Customize the CRUD id property{1495x334}](docs-img:customize-crud-id-property-key.png) +![Customize the CRUD id property{1264x334}](docs-img:customize-crud-id-property-key.png) ## Overriding a route diff --git a/content/docs/latest/api-endpoints/routing.md b/content/docs/latest/api-endpoints/routing.md index 88588e46..5580080f 100644 --- a/content/docs/latest/api-endpoints/routing.md +++ b/content/docs/latest/api-endpoints/routing.md @@ -20,7 +20,7 @@ Open the **Environment Settings** by clicking on the tab at the top of the windo Then, fill the **API prefix** input at the top of the **environment Settings**: -![fill the prefix input{1108x298}](docs-img:environment-prefix.png) +![fill the prefix input{993x298}](docs-img:environment-prefix.png) The prefix will appear under your environment name in the environments list. All your environment's routes will now be prefixed and available at the following address `http://localhost:port/myprefix/myroute` instead of `http://localhost:port/myroute`. @@ -45,7 +45,7 @@ Routes support certain patterns and a subset of regular expressions. Here are so - `/ab+cd` will match `abcd`, `abbcd`, `abbbcd`, and so on. - `/ab(cd)?e` will match `/abe` and `/abcde`. -![route pattern{1168x74}](docs-img:route-patterns.png) +![route pattern{995x74}](docs-img:route-patterns.png) For a complete overview of the patterns available, please refer to Express' [route paths documentation](https://expressjs.com/en/guide/routing.html#route-paths). @@ -56,7 +56,7 @@ For a complete overview of the patterns available, please refer to Express' [rou Route parameters can be defined in routes by using a colon `:`. The name of a parameter can only contains the following characters `A-Za-z0-9_`. -![route parameter{1168x74}](docs-img:route-params.png) +![route parameter{995x74}](docs-img:route-params.png) For a complete overview on how to use and declare route parameters, please refer to Express' [route parameters documentation](https://expressjs.com/en/guide/routing.html#route-parameters). diff --git a/content/docs/latest/api-endpoints/templates-and-ai-assistant.md b/content/docs/latest/api-endpoints/templates-and-ai-assistant.md index bf0ebb16..a561b10a 100644 --- a/content/docs/latest/api-endpoints/templates-and-ai-assistant.md +++ b/content/docs/latest/api-endpoints/templates-and-ai-assistant.md @@ -27,7 +27,7 @@ To use a template in your routes, click on the "From template" entry in the rout Then, select the template you want to use and either copy-paste its content manually or click on one of the two buttons to create a new **GET endpoint** or a **CRUD endpoint with a data bucket**. -![create get route from template{860x759}](docs-img:templates-create-get-route.png) +![create get route from template{860x801}](docs-img:templates-create-get-route.png) The "GET route" button will create a new HTTP GET route and copy the template content as the body. The "CRUD + data" button will create a new CRUD endpoint with a linked data bucket and copy the template content as the data bucket content. @@ -39,15 +39,15 @@ You can also use our AI assistant to generate realistic mock data for your vario To generate a new template, click the "From template" button in the route creation menu (see above), and select the "Generate" tab: -![AI assistant generate tab{860x759}](docs-img:ai-assistant-generate-template-tab.png) +![AI assistant generate tab{860x801}](docs-img:ai-assistant-generate-template-tab.png) Then, write a prompt (e.g. "list of users") and click the "Generate" button. -![AI assistant generate button click{860x759}](docs-img:ai-assistant-generate-button.png) +![AI assistant generate button click{860x801}](docs-img:ai-assistant-generate-button.png) Finally, you can copy-paste the generated template manually or click on one of the two buttons to create a new **GET endpoint** or a **CRUD endpoint with a data bucket**. -![create get route from template{860x759}](docs-img:templates-generate-get-route.png) +![create get route from template{860x801}](docs-img:templates-generate-get-route.png) ### Writing prompts @@ -58,7 +58,7 @@ Several options are available to fine-tune the generated templates: - **array**: the generated template root level will be a JSON array (usually used with the **JSON** option). - **templating**: the generated template will contain Handlebars [templating helpers](docs:templating/overview) (e.g. `{{faker 'person.firstName'}}`). Please note that disabling this option usually results in longer templates. -![prompt options buttons{860x759}](docs-img:ai-assistant-template-generate-options.png) +![prompt options buttons{860x801}](docs-img:ai-assistant-template-generate-options.png) You will obtain best results with shorter prompts: "list of users", "JSON configuration for library X", etc. diff --git a/content/docs/latest/callbacks/overview.md b/content/docs/latest/callbacks/overview.md index a839b8b0..b477cc57 100644 --- a/content/docs/latest/callbacks/overview.md +++ b/content/docs/latest/callbacks/overview.md @@ -24,7 +24,7 @@ To create a new callback, open the **Callbacks** options by clicking on the tab Add a new callback by clicking on the "plus" button: -![Add a new callback by clicking on the plus button{1495x578}](docs-img:add-callback.png) +![Add a new callback by clicking on the plus button{1264x578}](docs-img:add-callback.png) ## Configure a callback diff --git a/content/docs/latest/callbacks/using-callbacks.md b/content/docs/latest/callbacks/using-callbacks.md index f55c93cf..b64f3429 100644 --- a/content/docs/latest/callbacks/using-callbacks.md +++ b/content/docs/latest/callbacks/using-callbacks.md @@ -16,10 +16,10 @@ After [creating callbacks](docs:callbacks/overview), you can link them in your r To link a callback to a route response, choose "Callbacks" in the route response menu: -![click on the callbacks tab in the route response menu{1228x153}](docs-img:open-route-response-callbacks.png) +![click on the callbacks tab in the route response menu{997x153}](docs-img:open-route-response-callbacks.png) Then, click on the "plus" button to add a new callback, and select the callback you want to link: -![click on the plus button to add a new callback{1208x234}](docs-img:link-callback-response.png) +![click on the plus button to add a new callback{977x234}](docs-img:link-callback-response.png) > 💡 You can **delay a callback execution** by adding a delay in milliseconds in the "Callback latency" field. diff --git a/content/docs/latest/data-buckets/overview.md b/content/docs/latest/data-buckets/overview.md index 11b2b141..6ecf2efa 100644 --- a/content/docs/latest/data-buckets/overview.md +++ b/content/docs/latest/data-buckets/overview.md @@ -24,7 +24,7 @@ To create a new data bucket, open the **Data** options by clicking on the tab at Add a new data bucket by clicking on the "plus" button: -![Add a data bucket{1495x578}](docs-img:add-data-bucket.png) +![Add a data bucket{1264x578}](docs-img:add-data-bucket.png) You can change the data bucket title and content on the right part of the screen. Mockoon will automatically attribute a new **unique ID** to your data bucket. You can use this ID to reference the data using the [`data` helpers](docs:data-buckets/using-data-buckets#using-data-helpers). To retrieve a bucket's unique ID, look in the footer under the data bucket content or right-click on a bucket name in the list and click on "Copy ID to clipboard". @@ -48,7 +48,7 @@ You can easily combine your data bucket contents by referencing other data bucke } ``` -> ⚠️ However, data buckets are generated in the order they are defined in the environment. As a consequence, you cannot reference a data bucket that is defined **after** the current one. +> ⚠️ Data buckets are generated in the order they are defined in the environment. As a consequence, you cannot reference a data bucket that is defined **after** the current one. You can easily reorder your data buckets by dragging and dropping them in the list. ## Data buckets generation diff --git a/content/docs/latest/data-buckets/using-data-buckets.md b/content/docs/latest/data-buckets/using-data-buckets.md index cc1a503c..ef7020da 100644 --- a/content/docs/latest/data-buckets/using-data-buckets.md +++ b/content/docs/latest/data-buckets/using-data-buckets.md @@ -34,4 +34,4 @@ A data bucket can also be directly linked to a route response. Linking a data bu To link a data bucket to a route response, choose "Data" in the body selector and select your data bucket. -![Using data bucket in a route response{1233x464}](docs-img:link-data-bucket-response.png) +![Using data bucket in a route response{1002x464}](docs-img:link-data-bucket-response.png) diff --git a/content/docs/latest/logging-and-recording/auto-mocking-and-recording.md b/content/docs/latest/logging-and-recording/auto-mocking-and-recording.md index 541dc145..61b0e836 100644 --- a/content/docs/latest/logging-and-recording/auto-mocking-and-recording.md +++ b/content/docs/latest/logging-and-recording/auto-mocking-and-recording.md @@ -16,17 +16,17 @@ You can automatically create mock routes from HTTP transactions (request/respons Mockoon offers the possibility to automatically create mocks for entering requests. Click on the "plus" icon on a record to create a route containing the same information (headers, body, etc.): -![create a route from a log{1445x568}](docs-img:logs-auto-mocking.png) +![create a route from a log{1214x633}](docs-img:logs-auto-mocking.png) ## Record your API calls Mockoon can also automatically create mock API endpoints every time a request is logged. To activate this feature, click on the "Record" button at the top of the logs view: -![click on the record button{1445x568}](docs-img:logs-start-recording.png) +![click on the record button{1214x633}](docs-img:logs-start-recording.png) You can record in multiple environments at the same time. A red blinking recording icon will appear next to the environment name to indicate that the recording is active: -![recording icon{1195x368}](docs-img:logs-recording-in-progress.png) +![recording icon{964x433}](docs-img:logs-recording-in-progress.png) The recording will only create a route once, based on the path and HTTP method. diff --git a/content/docs/latest/logging-and-recording/requests-logging.md b/content/docs/latest/logging-and-recording/requests-logging.md index e77dde90..5650ec92 100644 --- a/content/docs/latest/logging-and-recording/requests-logging.md +++ b/content/docs/latest/logging-and-recording/requests-logging.md @@ -22,21 +22,21 @@ The list shows all intercepted requests and how Mockoon answered to them. Please note that all requests are intercepted, even the `/favicon` request made by the browser. Each record contains the entering request and the outgoing response information. This includes the complete list of headers, route params, query params, and body in raw format. -![view the request{1445x568}](docs-img:logs-request.png) +![view the request{1214x633}](docs-img:logs-request.png) -![view the response{1445x568}](docs-img:logs-response.png) +![view the response{1214x633}](docs-img:logs-response.png) The interface is showing truncated bodies for both the request and the response (the truncation length can be adjusted in the settings). You can still view them in full in a separated editor by clicking on **View full body in editor**: -![click on view full body in editor link{1445x568}](docs-img:logs-view-body.png) +![click on view full body in editor link{1214x633}](docs-img:logs-view-body.png) -![body content is showed in a modal{860x663}](docs-img:logs-view-body-modal.png) +![body content is showed in a modal{860x696}](docs-img:logs-view-body-modal.png) ## Logs metadata You can also easily see if a request has been caught by Mockoon (record shows a green tick) or has been passed to another URL if the [proxy mode](docs:server-configuration/proxy-mode) is activated (record shows a shield icon): -![view logs metadata{1445x568}](docs-img:logs-metadata.png) +![view logs metadata{1214x633}](docs-img:logs-metadata.png) ## File logging diff --git a/content/docs/latest/mockoon-data-files/data-storage-location.md b/content/docs/latest/mockoon-data-files/data-storage-location.md index b1840994..35d95152 100644 --- a/content/docs/latest/mockoon-data-files/data-storage-location.md +++ b/content/docs/latest/mockoon-data-files/data-storage-location.md @@ -30,7 +30,7 @@ You can move the data files to another folder by right-clicking on an environmen Mockoon can monitor data files' external changes and automatically reload the interface with the new information. This is particularly useful when you are editing the data files with an external editor or pulling changes from a git repository. You can activate this option in the settings: -![enable file monitoring in the settings{860x770}](docs-img:enable-file-watching.png) +![enable file monitoring in the settings{860x812}](docs-img:enable-file-watching.png) ## Old system (pre v1.16.0) diff --git a/content/docs/latest/mockoon-data-files/sharing-mock-api-files.md b/content/docs/latest/mockoon-data-files/sharing-mock-api-files.md index bb513a0b..75d1cb43 100644 --- a/content/docs/latest/mockoon-data-files/sharing-mock-api-files.md +++ b/content/docs/latest/mockoon-data-files/sharing-mock-api-files.md @@ -23,7 +23,7 @@ Each file can be easily shared with other Mockoon's users, "as-is". After [locat You can save your environment data files in a Git-tracked folder to make sharing easier. By default, an environment file JSON content is saved pretty-printed to allow comparing changes between two commits. You can disable pretty printing in the settings: -![disable pretty printing{860x770}](docs-img:storage-pretty-printing.png) +![disable pretty printing{860x812}](docs-img:storage-pretty-printing.png) ### Use a mock API with the CLI diff --git a/content/docs/latest/response-configuration/file-serving.md b/content/docs/latest/response-configuration/file-serving.md index 2b3c919f..4f09517c 100644 --- a/content/docs/latest/response-configuration/file-serving.md +++ b/content/docs/latest/response-configuration/file-serving.md @@ -16,7 +16,7 @@ Besides using the body editor, Mockoon allows you to serve different files for e To serve a file, you must provide a path in the file input field: -![fill the file input field{1218x354}](docs-img:file-path.png) +![fill the file input field{987x354}](docs-img:file-path.png) > When a file path is provided, the body editor content will be ignored. @@ -42,7 +42,7 @@ Templating can be disabled both for the body editor and the file content. Please > > Parsing the templating helpers inside big files can be a very intensive task (CPU and memory intensive). All the files in different formats than the one mentioned above will be streamed to improve performances. > If you need to send big files in one of the above formats but don't need to parse the templating, you can disable it in the route response settings. It will stream the file instead of parsing it and improve the performance. -> ![disable templating in route response{1297x181}](docs-img:route-response-disable-templating.png) +> ![disable templating in route response{1066x181}](docs-img:route-response-disable-templating.png) ### File input templating @@ -52,7 +52,7 @@ Templating is also supported directly in the **file input field**. It allows to By default, Mockoon will return an error in the body when a file is not found. It will still keep the status code you set up on your route response. You can instead choose to automatically return a 404 by activating an option in the route response settings: -![tick the 404 fallback checkbox{1297x231}](docs-img:enable-404-fallback.png) +![tick the 404 fallback checkbox{1066x231}](docs-img:enable-404-fallback.png) This option will also fall back to use the content present in the body editor. diff --git a/content/docs/latest/response-configuration/response-body.md b/content/docs/latest/response-configuration/response-body.md index 61a574d9..f1c2a3b3 100644 --- a/content/docs/latest/response-configuration/response-body.md +++ b/content/docs/latest/response-configuration/response-body.md @@ -14,13 +14,13 @@ Each [route response](docs:route-responses/multiple-responses) can serve a diffe You can choose each option using the body selector: -![body type toggle buttons{1495x540}](docs-img:body-type-toggle.png) +![body type toggle buttons{1264x540}](docs-img:body-type-toggle.png) ## Body editor (inline) You can use the body editor to directly create your response content. It supports all the [templating helpers](docs:templating/overview). -![inline body editor{1285x742}](docs-img:inline-body-editor.png) +![inline body editor{1169x807}](docs-img:inline-body-editor.png) > Mockoon will save the content of the inline body editor directly in your [data file](docs:mockoon-data-files/data-storage-location). > Using an external file could improve the performance for large content. @@ -29,7 +29,7 @@ You can use the body editor to directly create your response content. It support You can also choose to serve an external file, using the second option: -![external file linking input{1285x742}](docs-img:body-file-serving.png) +![external file linking input{1169x807}](docs-img:body-file-serving.png) Please refer to the [file serving documentation](docs:response-configuration/file-serving) for more information. @@ -37,6 +37,6 @@ Please refer to the [file serving documentation](docs:response-configuration/fil You can finally choose to serve the content of a data bucket using the third option: -![data bucket linking select menu{1285x742}](docs-img:body-data-bucket.png) +![data bucket linking select menu{1169x807}](docs-img:body-data-bucket.png) Please refer to the [data bucket documentation](docs:data-buckets/overview) for more information. diff --git a/content/docs/latest/response-configuration/response-headers.md b/content/docs/latest/response-configuration/response-headers.md index f24641a1..50df4da0 100644 --- a/content/docs/latest/response-configuration/response-headers.md +++ b/content/docs/latest/response-configuration/response-headers.md @@ -16,11 +16,11 @@ In Mockoon you can easily define **response headers** for **each route** but als To add response headers like `Content-Type` to your route, go to the route's **Headers tab** and fill the name and value fields: -![Complete route response header form{1228x204}](docs-img:fill-route-header-form.png) +![Complete route response header form{997x204}](docs-img:fill-route-header-form.png) You can add one or more headers by clicking on the "Add header" button at the bottom of the list: -![Add route response header{1208x234}](docs-img:add-route-header.png) +![Add route response header{977x234}](docs-img:add-route-header.png) ## Environment level response headers @@ -32,4 +32,4 @@ Open the **Environment Headers** by clicking on the tab at the top of the window And add one or more headers by clicking on the "Add header" button at the bottom of the list: -![Add environment header{1408x137}](docs-img:add-environment-header.png) +![Add environment header{1177x137}](docs-img:add-environment-header.png) diff --git a/content/docs/latest/route-responses/dynamic-rules.md b/content/docs/latest/route-responses/dynamic-rules.md index 014fa202..d9036869 100644 --- a/content/docs/latest/route-responses/dynamic-rules.md +++ b/content/docs/latest/route-responses/dynamic-rules.md @@ -20,7 +20,7 @@ You can define an unlimited number of rules for each route. At each request, Moc To add a new rule to a response, go to the route response's **Rules tab**, click on "Add rule" and fill the fields: -![Click on add and fill the fields{1218x304}](docs-img:add-route-response-rule.png) +![Click on add and fill the fields{987x304}](docs-img:add-route-response-rule.png) ### Reordering rules @@ -40,7 +40,7 @@ You can temporarily disable the rules and serve the default response only. To ac Inside a route response, rules are interpreted by default with the OR logical operator. When you have more than one rule in a route response, you can easily switch the operator applied when interpreting the rules, by clicking on the `OR|AND` buttons at the left of the rules: -![Choose the rule operator OR AND{1213x214}](docs-img:route-response-rules-operator.png) +![Choose the rule operator OR AND{982x214}](docs-img:route-response-rules-operator.png) Rules have four parts: @@ -52,20 +52,21 @@ Rules have four parts: ### 1. Target -![Rule target{1238x204}](docs-img:route-response-rules-target.png) +![Rule target{1007x204}](docs-img:route-response-rules-target.png) In the dropdown menu you can choose between: - the **body** value (full raw content or one of its properties if request's `Content-Type` is either `application/json`, `application/x-www-form-urlencoded`, `multipart/form-data`, `application/xml`, `application/soap+xml` or `text/xml`). +- the value of a **query string field**. - the value of a **header**. - the value of a **cookie**. - the value of a **route parameter**. -- the value of a **query string field**. +- the value of a **global variable**. - the **request number** index starting at 1. ### 2. Property name or path -![Rule property{1238x204}](docs-img:route-response-rules-property.png) +![Rule property{1007x204}](docs-img:route-response-rules-property.png) Depending on the **target**, the way to access properties may be different: @@ -75,10 +76,11 @@ Depending on the **target**, the way to access properties may be different: Fetching object properties is compatible with request's bodies of `Content-Type` `application/json`, `application/x-www-form-urlencoded`, `multipart/form-data`, `application/xml`, `application/soap+xml` or `text/xml`. _Please note that XML bodies are parsed using [xml-js](https://www.npmjs.com/package/xml-js) package. Refer to this [page](docs:response-configuration/xml-support) or the package documentation for more information on how the XML is parsed and how to fetch specific properties._ _Please also note that `multipart/form-data` only supports fields. Uploaded files will be ignored._ +- **query string**: either provide a property name like `filter` or a path if the query string field is an object `filter.primary`. - **headers**: a header name like `Accept` or `Content-Type`. - **cookies**: the cookie name like `Session-id`. - **route param**: a route param name without the colon (":"), `:userId` becoming `userId`. -- **query string**: either provide a property name like `filter` or a path if the query string field is an object `filter.primary`. +- **global variable**: a [global variable](docs:global-variables/overview) name like `myVar`. You can use a path to access one of its properties if the variable is storing arrays or objects. Two syntaxes are supported, [object-path](https://www.npmjs.com/package/object-path) or [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus). When using object-path, properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. Examples: `myVar.property.subProperty`, `myVar.property.0.subProperty` or `$.myVar.property`. - **request number**: _nothing has to be provided here for the request number_. For **body** and **query string**, if the property is an array, Mockoon will automatically check in the array if at least one item matches the value. @@ -87,11 +89,11 @@ For **body** and **query string**, if the property is an array, Mockoon will aut You can invert the **comparison operator** (**!** equals, **!** regex match, etc.) by toggling on the exclamation mark button: -![Rule comparison operator{1238x204}](docs-img:route-response-rules-invert-operator.png) +![Rule comparison operator{1007x204}](docs-img:route-response-rules-invert-operator.png) ### 4. Comparison operator -![Rule comparison operator{1238x204}](docs-img:route-response-rules-comparison-operator.png) +![Rule comparison operator{1007x204}](docs-img:route-response-rules-comparison-operator.png) Multiple comparison operators are available in each rule: @@ -102,7 +104,7 @@ Multiple comparison operators are available in each rule: ### 5. Value -![Rule value{1238x204}](docs-img:route-response-rules-value.png) +![Rule value{1007x204}](docs-img:route-response-rules-value.png) Depending on the comparison operator chosen, **equals** or **regex match**, you can either set a simple text value like "expected value" or any kind of regex. To use a regex, you must write it without the leading and trailing slashes. diff --git a/content/docs/latest/route-responses/global-routes-with-rules.md b/content/docs/latest/route-responses/global-routes-with-rules.md index 0ba5bff5..d48fa9b9 100644 --- a/content/docs/latest/route-responses/global-routes-with-rules.md +++ b/content/docs/latest/route-responses/global-routes-with-rules.md @@ -18,7 +18,7 @@ Three parts are required to create a global route: To create a global route, you first need to create a new HTTP route that will match all the endpoints you want to protect. To do so, create a new route and select "All methods" in the method dropdown: -![wildcard route on all methods{599x325}](docs-img:create-wildcard-route.png) +![wildcard route on all methods{599x318}](docs-img:create-wildcard-route.png) In this example, the wildcard route is placed above the `GET /users` route, which is important as it will be [evaluated first](docs:api-endpoints/routing#routes-order) and catch all the requests. You can create it first or move it up in the routes list with a drag and drop. @@ -30,11 +30,11 @@ In this example, the wildcard route is placed above the `GET /users` route, whic The second step is to create one or more responses with rules. For example, you can create a response checking that the request contains an `Authorization` header and returning a `401` error if's not present. To follow this example, use the existing response or create a new one and set the status code to `401`: -![create response with status code 401{1237x261}](docs-img:response-status-code-401.png) +![create response with status code 401{1006x261}](docs-img:response-status-code-401.png) Add a new rule to this response by clicking on the "add rule" button and selecting the "Header" rule type. Then, set the rule to check that the `Authorization` header is null as we want to return a `401` error if it is not present: -![create rule to check that the Authorization header is null{1218x304}](docs-img:response-rule-header-null.png) +![create rule to check that the Authorization header is null{987x304}](docs-img:response-rule-header-null.png) > 💡 You can create more responses with associated rules to verify more criteria on the request and serve different responses accordingly (errors, etc.). @@ -42,7 +42,7 @@ Add a new rule to this response by clicking on the "add rule" button and selecti Once your route is created and your responses customized, activate the fallback mode by clicking on the "fallback" icon next to the response list: -![Activate fallback mode{1289x174}](docs-img:activate-fallback-mode.png) +![Activate fallback mode{1264x174}](docs-img:activate-fallback-mode.png) This will automatically pass the request to the next route when none of the [responses' rules](docs:route-responses/dynamic-rules) match. diff --git a/content/docs/latest/route-responses/multiple-responses.md b/content/docs/latest/route-responses/multiple-responses.md index 7b3e7030..a47ff054 100644 --- a/content/docs/latest/route-responses/multiple-responses.md +++ b/content/docs/latest/route-responses/multiple-responses.md @@ -16,7 +16,7 @@ For each route, multiple responses can be defined (status, body, and headers) an To **add** a new response to your route, click on the "plus" icon next to the responses list: -![Click on the icon to add a new response{1218x164}](docs-img:add-route-response.png) +![Click on the icon to add a new response{987x164}](docs-img:add-route-response.png) You can also **duplicate** an existing route response by clicking on the "copy" icon on the right: @@ -28,7 +28,7 @@ Everything will be copied to the new response: documentation, file/body, headers Route responses order define the order in which the [rules are interpreted](docs:route-responses/dynamic-rules). You can easily change the default response by reordering the responses menu with a drag and drop: -![Reorder route responses{1199x214}](docs-img:reorder-responses.png) +![Reorder route responses{968x214}](docs-img:reorder-responses.png) ## Default route response diff --git a/content/docs/latest/server-configuration/cors.md b/content/docs/latest/server-configuration/cors.md index 3a507f6a..6c243937 100644 --- a/content/docs/latest/server-configuration/cors.md +++ b/content/docs/latest/server-configuration/cors.md @@ -3,7 +3,7 @@ title: CORS meta: title: Automatic handling of CORS preflight OPTIONS requests description: Front-end application and your JSON mock API are not on the same domain? Handle preflight OPTIONS requests automatically with Mockoon -order: 120 +order: 130 --- # CORS @@ -42,12 +42,12 @@ You can also add the same CORS headers to all routes of a mock API with one clic Open the **Environment Headers** by clicking on the tab at the top of the window: -![click on the headers tab{1495x160}](docs-img:open-environment-headers.png) +![click on the headers tab{1264x160}](docs-img:open-environment-headers.png) Then, click on the **Add CORS headers** link: -![Click on the add CORS headers link{1495x137}](docs-img:add-cors-headers.png) +![Click on the add CORS headers link{1264x137}](docs-img:add-cors-headers.png) The above headers will be automatically added to your list of headers: -![view cors headers in the list{1495x237}](docs-img:view-cors-headers.png) +![view cors headers in the list{1264x237}](docs-img:view-cors-headers.png) diff --git a/content/docs/latest/server-configuration/listening-hostname.md b/content/docs/latest/server-configuration/listening-hostname.md index ab3117de..c7042e8c 100644 --- a/content/docs/latest/server-configuration/listening-hostname.md +++ b/content/docs/latest/server-configuration/listening-hostname.md @@ -3,7 +3,7 @@ title: Listening hostname/adapter meta: title: Listening hostname or adapter description: Learn how you can customize the hostname or network adapter your mock API will listen to in the desktop application or the CLI -order: 130 +order: 140 --- # Listening hostname/adapter @@ -18,8 +18,8 @@ To configure each environment to listen on a specific hostname, open the **Envir Add a **custom hostname** in the input field: -![field to set a custom hostname{1495x213}](docs-img:custom-hostname-setting.png) +![field to set a custom hostname{1264x213}](docs-img:custom-hostname-setting.png) -> You may need to restart your environment for the change to take effect. +> ⚠️ You may need to restart your environment for the change to take effect. -> When using the CLI, you can choose a specific adapter to listen to (e.g. `192.168.1.1`) by using the `--hostname` flag with the [`start` command](https://github.com/mockoon/mockoon/tree/main/packages/cli#mockoon-cli-start). +> 💡 When using the CLI, you can choose a specific adapter to listen to (e.g. `192.168.1.1`) by using the `--hostname` flag with the [`start` command](https://github.com/mockoon/mockoon/tree/main/packages/cli#mockoon-cli-start). diff --git a/content/docs/latest/server-configuration/port-prefix.md b/content/docs/latest/server-configuration/port-prefix.md new file mode 100644 index 00000000..36025d2e --- /dev/null +++ b/content/docs/latest/server-configuration/port-prefix.md @@ -0,0 +1,25 @@ +--- +title: Port and prefix +meta: + title: Change port and API prefix + description: Learn how you can customize the localhost port and API prefix of your mock server. +order: 100 +--- + +# Port and prefix + +--- + +By default, Mockoon's new environments will listen on port `3000` and will have **no API prefix**. If you have multiple environments already opened, Mockoon will automatically increment the port number for each new environment. + +You can change the **port number** and the **API prefix** in the **Environment Settings** by clicking on the tab at the top of the window: + +![click on the settings tab{871x160}](docs-img:open-environment-settings.png) + +Then, change the port number and/or the API prefix in the corresponding input fields: + +![field to set a custom port{583x298}](docs-img:environment-custom-port.png) + +![field to set a custom prefix{993x298}](docs-img:environment-custom-prefix.png) + +> 💡 The API prefix can contain multiple sections (e.g. `/api/v1/`) and will be applied to all your routes. diff --git a/content/docs/latest/server-configuration/proxy-mode.md b/content/docs/latest/server-configuration/proxy-mode.md index db86f101..46175ff2 100644 --- a/content/docs/latest/server-configuration/proxy-mode.md +++ b/content/docs/latest/server-configuration/proxy-mode.md @@ -3,7 +3,7 @@ title: Partial mocking with proxy mode meta: title: Partial API mocking with proxy mode description: Learn how to create a mock REST API to intercept traffic and proxy requests to another JSON REST server with Mockoon -order: 100 +order: 110 --- # Proxy mode @@ -20,7 +20,7 @@ To activate the proxy mode, open the **Environment Proxy** options by clicking o Enable the proxy mode by checking the box and enter the server URL to which you want to forward the calls. A small shield icon should appear on the right of your environment name indicating that the proxy mode has been enabled: -![tick the Proxy checkbox{1495x277}](docs-img:enable-proxy.png) +![tick the Proxy checkbox{1264x277}](docs-img:enable-proxy.png) From now on, all routes that have been defined in Mockoon will be intercepted, and any other request not matching any route path will be forwarded to the server URL you entered in the proxy mode setting. @@ -34,6 +34,6 @@ By default, the API prefix will be part of the path called on the proxied API. Y Proxy specific headers can also be added, both to the forwarded request and the response received from the target API. -![add proxy headers by filling the keys and values{1495x379}](docs-img:proxy-headers.png) +![add proxy headers by filling the keys and values{1264x379}](docs-img:proxy-headers.png) > **Proxy request headers** will be automatically added to the request sent to the proxied server, while **proxy response headers** are added to the response received from the proxied server. diff --git a/content/docs/latest/server-configuration/serving-over-tls.md b/content/docs/latest/server-configuration/serving-over-tls.md index 8c7dd9bb..52fcf79e 100644 --- a/content/docs/latest/server-configuration/serving-over-tls.md +++ b/content/docs/latest/server-configuration/serving-over-tls.md @@ -3,7 +3,7 @@ title: TLS meta: title: Serve a mock API over TLS description: Need to mock a secured REST API server? Mockoon can also do this by serving over TLS with a self-signed certificate -order: 110 +order: 120 --- # TLS @@ -32,7 +32,7 @@ Please note that Mockoon is using a self-signed certificate to serve your enviro You can also provide your certificate in both PKCS12 or PEM formats by filling out the input fields with the path to the file(s). -![add certificate path{1495x612}](docs-img:enable-tls-custom-certificate.png) +![add certificate path{1264x612}](docs-img:enable-tls-custom-certificate.png) Mockoon also supports passphrase-protected keys and custom-trusted CA certificates. As Mockoon is using Node.js' `tls`, you can refer to the [`tls.createSecureContext()` documentation](https://nodejs.org/dist/latest-v16.x/docs/api/tls.html#tlscreatesecurecontextoptions) for a full description of the available options. diff --git a/content/docs/latest/templating/fakerjs-helpers.md b/content/docs/latest/templating/fakerjs-helpers.md index 6aebdcd4..0c6785d4 100644 --- a/content/docs/latest/templating/fakerjs-helpers.md +++ b/content/docs/latest/templating/fakerjs-helpers.md @@ -26,21 +26,37 @@ All Faker.js helpers must be used with the following syntax: `{{faker 'namespace ... ``` -Faker.js methods may use two different ways of passing parameters: ordered arguments or options objects. Wrapped in Handlebars helpers, this may result in two different ways of using them: +Faker.js methods may use two different ways of passing parameters: **ordered arguments** or **option object** (with eventually a depth > 1). Wrapped in a Handlebars helper, this may result in different syntaxes: -```js -// named parameters -{{faker 'number.int' min=0 max=25}} +- **Ordered arguments**: `{{faker 'namespace.method' arg1 arg2 arg3}}` -// ordered arguments (here count=25) +```handlebars +{{faker 'number.int' 100}} + {{faker 'string.alphanumeric' 25}} ``` +- **Option object** with **named parameters**: `{{faker 'namespace.method' arg1='value1' arg2='value2'}}` will be translated to an option object `{ arg1: 'value1', arg2: 'value2' }` + +```handlebars +{{faker 'number.int' min=10 max=100}} +{{faker 'string.alphanumeric' casing='mixed' length=50}} +``` + +- **Option object** with **named parameters** and **depth > 1**: `{{faker 'namespace.method' '{arg1: "value1", arg2: { prop1: "value2"}}'}}` will be translated to a complex option object `{ arg1: 'value1', arg2: { prop1: 'value2' } }`. Be sure to **escape** the single or double quotes inside your option string accordingly. + +```handlebars +{{faker 'number.int' '{min: 10, max: 100}'}} +{{faker 'string.alphanumeric' '{casing: "lower", length: { min: 1, max: 3}}'}} +``` + +> 📘 Please check Faker.js documentation to know which syntax to use for each helper. + ## Set Faker.js' locale and seed Faker.js locale and seed can be defined in the application settings: -![fakerjs settings{860x770}](docs-img:settings-faker.png) +![fakerjs settings{860x812}](docs-img:settings-faker.png) The locale and seed can also be set when running your mock using the [CLI's flags](https://github.com/mockoon/mockoon/blob/main/packages/cli/README.md#fakerjs-options) or the [serverless package options](https://github.com/mockoon/mockoon/blob/main/packages/serverless/README.md#options). diff --git a/content/docs/latest/templating/mockoon-helpers.md b/content/docs/latest/templating/mockoon-helpers.md index ceb29195..97d9b25f 100644 --- a/content/docs/latest/templating/mockoon-helpers.md +++ b/content/docs/latest/templating/mockoon-helpers.md @@ -45,6 +45,7 @@ In addition to Handlebars' built-in helpers, Mockoon offers the following helper | [`uppercase`](#uppercase) | [`padStart`](#padstart) | [`time`](#time) | [`objectId`](#objectid) | | [`split`](#split) | [`padEnd`](#padend) | [`dateFormat`](#dateformat) | | | [`stringify`](#stringify) | [`eq`](#eq) | | | +| [`jsonParse`](#jsonparse) | | | | | [Faker.js](docs:templating/fakerjs-helpers) aliases | | | | --------------------------------------------------- | ----------------------------- | ----------------------- | @@ -195,14 +196,14 @@ result: item2 ## someOf -Return a random number of items from the array passed in parameters, concatenated as a string. Use it with triple curly braces to get a JSON representation. +Return an array containing a random number of items from the array passed in parameters, eventually stringified. Use it with triple curly braces to get a non-escaped JSON representation. | Arguments (ordered) | Type | Description | | ------------------- | ------- | ----------------------- | | 0 | any[] | Array of values | | 1 | number | Minimum number of items | | 2 | number | Maximum number of items | -| [3 = false] | boolean | Get result as an array | +| [3 = false] | boolean | Stringify the result | **Examples** @@ -210,9 +211,9 @@ Return a random number of items from the array passed in parameters, concatenate {{someOf (array 'item1' 'item2' 'item3') 1 2}} result: item1,item2 - + {{{someOf (array 'item1' 'item2' 'item3') x y true}}} -result: item1,item2 +result: ["item1","item2"] ``` ## join @@ -933,6 +934,36 @@ Considering an entering body: } ``` +## jsonParse + +Parse a valid JSON string. The result can be used with other helpers like `each`, `if`, `oneOf`, `lookup`, etc. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | -------------------------- | +| 0 | string | Valid JSON string to parse | + +**Examples** + +```handlebars +{{#if (jsonParse 'true')}} + value +{{/if}} + +{{#if (eq (jsonParse '25') 25)}} + value +{{/if}} + +{{oneOf (jsonParse '[5, 56, 98]')}} +result: 5 or 56 or 98 + +{{lookup (jsonParse '{"data":"test"}') 'data'}} +result: test + + +{{lookup (jsonParse (queryParam 'json')) 'data'}} +result: test +``` + ## concat Concatenate multiple strings/numbers together. This helper can concatenate results from other helpers, or be used as a parameter of another helper (see examples below). diff --git a/content/docs/latest/templating/overview.md b/content/docs/latest/templating/overview.md index b40786a7..25d92ede 100644 --- a/content/docs/latest/templating/overview.md +++ b/content/docs/latest/templating/overview.md @@ -74,7 +74,7 @@ Here is an example of what you can do with this templating system: } ``` -![body editor content{1194x493}](docs-img:body-templating.png) +![body editor content{963x558}](docs-img:body-templating.png) The above template produces the following body with this request: @@ -171,11 +171,11 @@ Templating can be disabled for the body and file content in each route response First, open the **Route response settings**: -![click on route response fourth settings tab{1228x153}](docs-img:open-route-response-settings.png) +![click on route response fourth settings tab{997x153}](docs-img:open-route-response-settings.png) Then, disable the templating by checking the box: -![check the disable templating box{1277x181}](docs-img:disable-route-response-templating.png) +![check the disable templating box{1046x181}](docs-img:disable-route-response-templating.png) ### File input templating @@ -187,7 +187,7 @@ If you have a set of files named `./file1.json` and `./file2.json`, a route para If you call this route with `/myroute/1`, `./file1.json` will be sent. -![add a templating helper in the file path{1208x184}](docs-img:file-path-templating.png) +![add a templating helper in the file path{977x184}](docs-img:file-path-templating.png) > For more information about absolute and relative file paths, please refer to our [file serving](docs:response-configuration/file-serving#absolute-or-relative-paths) documentation. @@ -195,8 +195,8 @@ If you call this route with `/myroute/1`, `./file1.json` will be sent. Templating helpers can also be used in the **headers values** both in route headers and environment headers: -![add a templating helper in the header value{1228x223}](docs-img:headers-templating.png) +![add a templating helper in the header value{997x223}](docs-img:headers-templating.png) Finally, templating helpers can be used in the response **rule values** to create dynamic rules: -![screenshot showing a response rule with a template helper in the value field{1228x164}](docs-img:template-helper-response-rule-value.png) +![screenshot showing a response rule with a template helper in the value field{997x164}](docs-img:template-helper-response-rule-value.png) diff --git a/content/docs/v5.1.0/openapi/import-export-openapi-format.md b/content/docs/v5.1.0/openapi/import-export-openapi-format.md index 8adf3476..ab3b4e37 100644 --- a/content/docs/v5.1.0/openapi/import-export-openapi-format.md +++ b/content/docs/v5.1.0/openapi/import-export-openapi-format.md @@ -27,5 +27,3 @@ To export an environment to a JSON file, open the **Import/export** menu, select ### Compatibility Compatibility between the OpenAPI specification and Mockoon's features is only partial and detailed in the [next article](docs:openapi/openapi-specification-compatibility). - ->
    {"type": "##sponsoring##", "text": "For those looking to further leverage OpenAPI specifications in their workflow, consider Fern. Fern is an open-source toolkit that uses your API definition to generate idiomatic SDKs, server-side code, and beautiful documentation. Its schema-first design approach and automated outputs can provide a comprehensive solution for those seeking to optimize their OpenAPI workflow.", "link": "https://www.devmark.ai/fern/?utm_source=mockoon&utm_loc=docs-1&utm_type=embedding"}
    diff --git a/content/docs/v5.1.0/openapi/openapi-specification-compatibility.md b/content/docs/v5.1.0/openapi/openapi-specification-compatibility.md index f28c21f9..34121e93 100644 --- a/content/docs/v5.1.0/openapi/openapi-specification-compatibility.md +++ b/content/docs/v5.1.0/openapi/openapi-specification-compatibility.md @@ -28,5 +28,3 @@ OpenAPI import and export currently support the following API information: - Routes paths (including route parameters translated to `/:param`), methods, responses with status code (200, etc.), headers, and descriptions. _Import only_: sample responses and JSON bodies are created from OpenAPI schemas and examples during import. - ->
    {"type": "##sponsoring##", "text": "For those looking to further leverage OpenAPI specifications in their workflow, consider Fern. Fern is an open-source toolkit that uses your API definition to generate idiomatic SDKs, server-side code, and beautiful documentation. Its schema-first design approach and automated outputs can provide a comprehensive solution for those seeking to optimize their OpenAPI workflow.", "link": "https://www.devmark.ai/fern/?utm_source=mockoon&utm_loc=docs-2&utm_type=embedding"}
    diff --git a/content/docs/v6.0.1/openapi/import-export-openapi-format.md b/content/docs/v6.0.1/openapi/import-export-openapi-format.md index 8adf3476..ab3b4e37 100644 --- a/content/docs/v6.0.1/openapi/import-export-openapi-format.md +++ b/content/docs/v6.0.1/openapi/import-export-openapi-format.md @@ -27,5 +27,3 @@ To export an environment to a JSON file, open the **Import/export** menu, select ### Compatibility Compatibility between the OpenAPI specification and Mockoon's features is only partial and detailed in the [next article](docs:openapi/openapi-specification-compatibility). - ->
    {"type": "##sponsoring##", "text": "For those looking to further leverage OpenAPI specifications in their workflow, consider Fern. Fern is an open-source toolkit that uses your API definition to generate idiomatic SDKs, server-side code, and beautiful documentation. Its schema-first design approach and automated outputs can provide a comprehensive solution for those seeking to optimize their OpenAPI workflow.", "link": "https://www.devmark.ai/fern/?utm_source=mockoon&utm_loc=docs-1&utm_type=embedding"}
    diff --git a/content/docs/v6.0.1/openapi/openapi-specification-compatibility.md b/content/docs/v6.0.1/openapi/openapi-specification-compatibility.md index f28c21f9..34121e93 100644 --- a/content/docs/v6.0.1/openapi/openapi-specification-compatibility.md +++ b/content/docs/v6.0.1/openapi/openapi-specification-compatibility.md @@ -28,5 +28,3 @@ OpenAPI import and export currently support the following API information: - Routes paths (including route parameters translated to `/:param`), methods, responses with status code (200, etc.), headers, and descriptions. _Import only_: sample responses and JSON bodies are created from OpenAPI schemas and examples during import. - ->
    {"type": "##sponsoring##", "text": "For those looking to further leverage OpenAPI specifications in their workflow, consider Fern. Fern is an open-source toolkit that uses your API definition to generate idiomatic SDKs, server-side code, and beautiful documentation. Its schema-first design approach and automated outputs can provide a comprehensive solution for those seeking to optimize their OpenAPI workflow.", "link": "https://www.devmark.ai/fern/?utm_source=mockoon&utm_loc=docs-2&utm_type=embedding"}
    diff --git a/content/docs/v6.1.0/about.md b/content/docs/v6.1.0/about.md new file mode 100644 index 00000000..709d663f --- /dev/null +++ b/content/docs/v6.1.0/about.md @@ -0,0 +1,26 @@ +--- +title: About the documentation +meta: + title: Learn about Mockoon's documentation + description: Discover Mockoon's features and options, explore advanced topics and learn how to create fast and free mock API JSON servers. +order: 10 +--- + +# About the documentation + +--- + +This documentation covers Mockoon's most used features and options to help you create the best mock APIs. These topics apply to the [desktop application](/download/), [CLI](/cli/), and [serverless package](/serverless/) which supports the same features. +We maintain a documentation for the five latest desktop versions. Head over to our [releases section](/releases/) for more details about the changes in each version. + +If you find a mistake in the documentation, you can open an issue on the [website's repository](https://github.com/mockoon/mockoon.com). + +## CLI documentation + +You will find the [CLI documentation](https://github.com/mockoon/mockoon/blob/main/packages/cli/README.md) in its dedicated readme file on the repository. It covers the CLI's specific features, like the available flags or how to use the Docker file. + +## Serverless documentation + +You will find the [serverless package documentation](https://github.com/mockoon/mockoon/blob/main/packages/serverless/README.md) in its dedicated readme file on the repository. It covers the package usage instructions and specific features. + +> 🎓 Discover our official online course designed to help you get started with API mocking and API design. Coming soon! [Learn more](/course/) diff --git a/content/docs/v6.1.0/api-endpoints/crud-routes.md b/content/docs/v6.1.0/api-endpoints/crud-routes.md new file mode 100644 index 00000000..e9d1e52f --- /dev/null +++ b/content/docs/v6.1.0/api-endpoints/crud-routes.md @@ -0,0 +1,200 @@ +--- +title: CRUD routes +meta: + title: Mockoon CRUD routes documentation + description: All you need to know about Mockoon's mock API CRUD routes creation, behavior, data bucket operations and data manipulation. +order: 210 +--- + +# CRUD routes + +--- + +## Overview + +Where Mockoon routes are independent and stateless, CRUD routes can generate multiple endpoints to perform CRUD operations (Create, Read, Update, Delete) on [data buckets](docs:data-buckets/overview). Data buckets are generated when the server start, their state persisting between calls. It makes them the perfect tool to simulate small databases. + +A CRUD endpoint will automatically create a series of routes during runtime, allowing you to perform actions on your data bucket. A typical example is an array of resources (users, invoices, etc.) you can update through a PUT request and see the result in a subsequent GET request. + +To create a CRUD route, click on the "CRUD route" entry in the add route menu: + +![Add a new CRUD route{390x304}](docs-img:add-crud-route.png) + +Then, set its path, usually a [resource name](/articles/api-guide-rest-api-components/#resource-url-request): + +![Set the CRUD route path{1495x176}](docs-img:set-crud-route-path.png) + +> Your path can be more complex, and contains parameters or multiple sections. Remember that this will be the "prefix" of the different endpoints (see below). + +## Data bucket link + +After creating a CRUD endpoint, you need to link it to a data bucket: + +![Link a data bucket to a CRUD route{1495x334}](docs-img:link-data-bucket-crud-route.png) + +> Head over to our [data buckets](docs:data-buckets/overview) documentation to learn how to create a new data bucket. + +### Supported content + +The CRUD route will work with any content stored in your data bucket: valid JSON in the form of an array of objects, an object, a primitive, etc., or any non-valid JSON. The route behaviors will vary depending on the content stored in the bucket (see table below). + +> 🛠️ Use our [JSON validator](/tools/json-validator/) to check if your content is valid JSON. + +### Resetting the data bucket content + +The data bucket content is generated when the server starts, and its state persists between calls. However, its state will not be saved in the [data file](docs:mockoon-data-files/data-storage-location), and you can reset it to its initial state by restarting the mock API. + +## CRUD route differences + +When creating a CRUD route, you may notice some differences in the interface, namely: + +- The route HTTP method cannot be set and will be handled automatically. +- The status code cannot be changed and will be set automatically while performing operations. +- A fixed and default route response is automatically created and **must** be linked to a data bucket in order to perform CRUD operations. + +Latency and custom headers can still be added. However, an `application/json` `Content-Type` will be forced when appropriate. + +Also, CRUD routes are still compatible with creating [multiple responses and rules](docs:route-responses/multiple-responses). The major difference is that the default route response cannot be set and will always be the first one linked to the data bucket. This response cannot be deleted nor reordered. Aside from these differences everything else still applies. + +## List of routes and operations + +Mockoon will automatically translate a CRUD endpoint to multiple routes allowing for a wide range of behaviors. The system is very flexible and allows for any content, storing and updating primitives to simulate a flag or environment variable system, updating and sorting an array of objects, etc. + +| | | Array of objects | Array of primitives (`id` parameter is acting like an index) | Object, primitive or non-valid JSON | +| ---------- | ---------------- | -------------------------------------------------------------------------------- | ------------------------------------------------------------ | ----------------------------------------- | +| **GET** | `/resources` | Returns the entire array \* | Returns the entire array \* | Returns the content | +| **GET** | `/resources/:id` | Returns an object by its `id` property | Returns an item by its index | Returns the content | +| **POST** | `/resources` | Inserts a new object in the array (autogenerate the `id` (UUID) if not provided) | Inserts a new item in the array | Overwrites the content | +| **PUT** | `/resources` | Replaces the whole data bucket content | Replaces the whole data bucket content | Overwrites the content | +| **PUT** | `/resources/:id` | Performs a full object update by its `id` (replace) | Replaces the item at index | Overwrites the content | +| **PATCH** | `/resources` | Concatenates the arrays | Concatenates the arrays | Overwrites the content (merge if objects) | +| **PATCH** | `/resources/:id` | Performs a partial object update by its `id` (merge) | Replaces the item at index | Overwrites the content (merge if objects) | +| **DELETE** | `/resources` | Deletes the data bucket content | Deletes the data bucket content | Deletes the content | +| **DELETE** | `/resources/:id` | Deletes an object by its `id` | Deletes an item at index | Deletes the content | + +\* Supports [filtering, sorting and pagination](#filtering-sorting-and-pagination-on-the-main-get-route) + +> ⚠️ _Note:_ You can expect the above results assuming that you are sending the same type of content as the one stored in the data bucket (array ↔ array, object ↔ object, etc.). However, the system is very permissive, and you may push any content in an array, ending up with mixed type contents or replacing content with data of a different type. + +## Customizing the "id" property + +By default, CRUD endpoints will use the `id` property to identify objects in an array in all the routes manipulating a single resource (e.g. GET `/resource/:id`). However, you can change this property to anything you want, like `uuid`, `custom_id`, etc: + +![Customize the CRUD id property{1495x334}](docs-img:customize-crud-id-property-key.png) + +## Overriding a route + +You can easily override a CRUD operation route by declaring a regular HTTP route and putting it above the CRUD route (see [routes order](docs:api-endpoints/routing#routes-order)). This route will intercept the request allowing you to serve custom content for this operation. + +## Filtering, sorting and pagination on the main GET route + +The main `GET /path` route supports **filtering**, **sorting** and **pagination** when working with an **array**. + +### Filtering + +To filter an array, you can use query parameters in the form `[property]_[operator]`. For instance, if you want to filter an array of objects by their `status` property, you can use: + +``` +GET /path?status_eq=success +``` + +Currently, the following operators are supported: + +| Operator | Description | Example | +| -------- | --------------------------------------------- | ------------------- | +| `eq` | Filters by equality | `status_eq=success` | +| `ne` | Filters by inequality | `status_ne=error` | +| `gt` | Filters by greater | `price_gt=10` | +| `gte` | Filters by greater or equal | `price_gte=10` | +| `lt` | Filters by lower | `price_lt=10` | +| `lte` | Filters by lower or equal | `price_lte=10` | +| `like` | Filters by partial match \* | `name_like=ohn do` | +| `start` | Filters properties that start with a value \* | `name_start=john` | +| `end` | Filters properties that end with a value \* | `name_end=doe` | + +\* Case insensitive + +Filters work on every primitive value (strings, numbers, booleans, etc.), so you can filter by `true` or `false` values, or even `null` values: + +``` +GET /path?is_active_eq=true +``` + +It also works on arrays of primitives, in which case using `_[operator]` is enough: + +``` +GET /path?_gte=10 +``` + +Moreover, nesting is supported: + +``` +GET /path?user.email_end=@example.com +``` + +The `like`, `start` and `end` operators support regex patterns: + +``` +GET /path?user.name_like=^john +GET /path?user.id_like=^(123|456|789)$ +``` + +#### Searching + +To search an array, you can use the `search` query parameter. Search is a special kind of filter that will look for a partial match in any values (with nesting) in the array. For instance, if you want to search for `john` in an array of users, you can use: + +``` +GET /path?search=john +``` + +> Searching also works on arrays of primitives (strings, numbers, etc.) + +### Sorting + +To sort an array, you can use the `sort` and `order` query parameters. You can sort by any property in the objects (strings or numbers) and order by either ascending or descending order: + +``` +GET /path?sort=name&order=desc +``` + +Sorting is also working on arrays of primitives (strings, numbers, etc.), in which case, the presence of the `sort` parameter is enough: + +``` +GET /path?sort&order=asc +``` + +### Pagination + +To paginate an array, you can use the `page` and `limit` query parameters. If you omit the `limit` parameter, it will default to 10 per page. If you omit the `page` parameter, it will show you the first x items. + +Examples: + +- second set of 25 items: + + ``` + GET /path?page=2&limit=25 + ``` + +- first 50 items: + + ``` + GET /path?limit=50 + ``` + +- second set of 10 items: + ``` + GET /path?page=2 + ``` + +Filtering, sorting and pagination can work together and are applied in the order: filtering / searching, sorting, pagination. + +``` +GET /path?search=j&email_end=@example.com&sort=name&page=2&limit=25 +``` + +### Meta data + +When using CRUD endpoints, you can access meta data about the data bucket content through response headers: + +- `X-Total-Count`: total number of items in the bucket +- `X-Filtered-Count`: number of items after filtering (not taking into account pagination) diff --git a/content/docs/v6.1.0/api-endpoints/folders.md b/content/docs/v6.1.0/api-endpoints/folders.md new file mode 100644 index 00000000..5e4691e2 --- /dev/null +++ b/content/docs/v6.1.0/api-endpoints/folders.md @@ -0,0 +1,29 @@ +--- +title: Folders +meta: + title: Mockoon folders documentation + description: Everything about Mockoon API endpoint folder and sub-folders organization, reordering, auto repair and route precedence +order: 230 +--- + +# Folders + +--- + +## Organize your endpoints + +You can organize your routes into folders and sub-folders: + +![routes organized in folders and sub-folders{799x518}](docs-img:routes-nested-folder.png) + +This new feature allows you to better organize your routes and make your APIs more readable and easier to navigate, with a clearer hierarchy. +You can drag and drop to move or reorganize your routes and folders. + +## Routes order + +The server will create the endpoints in the same order they appear in the list, should they be inside folders or not. See the [routing](docs:api-endpoints/routing#routes-order) documentation for more information. + +## Repairing the data file + +If Mockoon's [data file](docs:mockoon-data-files/data-storage-location) has broken references due to improper manipulation of the JSON, such as missing routes or nonexistent folders, it will automatically be repaired upon loading. +If a route or folder does not exist, it will be automatically removed. On the other hand, unlisted routes and folders will be added back to the root level. diff --git a/content/docs/v6.1.0/api-endpoints/routing.md b/content/docs/v6.1.0/api-endpoints/routing.md new file mode 100644 index 00000000..88588e46 --- /dev/null +++ b/content/docs/v6.1.0/api-endpoints/routing.md @@ -0,0 +1,80 @@ +--- +title: Routing +meta: + title: Mockoon routing documentation + description: Everything about Mockoon mock API paths creation, API prefix, route parameters, query strings, wildcards and more +order: 200 +--- + +# Routing + +--- + +## API prefix + +In order to prefix all your mock API routes, + +Open the **Environment Settings** by clicking on the tab at the top of the window: + +![click on the settings tab{871x160}](docs-img:open-environment-settings.png) + +Then, fill the **API prefix** input at the top of the **environment Settings**: + +![fill the prefix input{1108x298}](docs-img:environment-prefix.png) + +The prefix will appear under your environment name in the environments list. All your environment's routes will now be prefixed and available at the following address `http://localhost:port/myprefix/myroute` instead of `http://localhost:port/myroute`. + +You need to restart the environment for the change to take effect. + +## API routes + +Mockoon uses Express to run the mock servers. In general, most of the Express' documentation applies. Please refer to the [routing documentation](https://expressjs.com/en/guide/routing.html) for more information and examples on the following topics. + +### Routes order + +Routes are declared in the server in the order displayed in the application (inside folders or not). This means that the first ones take precedence over the following ones. + +One consequence is that a route parameter will capture any value at the specific URL segment. For example, `/users/:id` or `/users/*` will intercept `/users/search`. The more specific "search" route should be declared first. You can always reorder routes by dragging and dropping them. + +### Route patterns and regexes + +Routes support certain patterns and a subset of regular expressions. Here are some examples of the available ones: + +- `/path/*` will match `/path/anything`. +- `/ab?cd` will match `/acd` and `/abcd`. +- `/ab+cd` will match `abcd`, `abbcd`, `abbbcd`, and so on. +- `/ab(cd)?e` will match `/abe` and `/abcde`. + +![route pattern{1168x74}](docs-img:route-patterns.png) + +For a complete overview of the patterns available, please refer to Express' [route paths documentation](https://expressjs.com/en/guide/routing.html#route-paths). + +> To use parentheses in your path as a normal character, you can escape them by either using a backslashe `\` or square brackets `[]`: +> `/part1[(]part2[)]` > `/part1\(part2\)` + +### Route parameters + +Route parameters can be defined in routes by using a colon `:`. The name of a parameter can only contains the following characters `A-Za-z0-9_`. + +![route parameter{1168x74}](docs-img:route-params.png) + +For a complete overview on how to use and declare route parameters, please refer to Express' [route parameters documentation](https://expressjs.com/en/guide/routing.html#route-parameters). + +You can also retrieve the route parameters by using the `{{urlParam 'paramName'}}` [templating helper](docs:templating/mockoon-request-helpers#urlparam). + +> To use a colon `:` in your route path as a normal character, you can escape it by either using double backslashes `\\` or square brackets `[]`: +> `/part1[:]part2` > `/part1\\:part2` + +### Query parameters + +Routes **must** be declared without query parameters as they are not part of the route path. They can only be added to the request when calling an endpoint. + +Query parameters can be retrieved by using the `{{queryParam 'paramName'}}` [templating helper](docs:templating/mockoon-request-helpers#queryparam). + +#### Query parameters arrays and objects + +Mockoon is using [qs](https://www.npmjs.com/package/qs) to parse the query string in a object usable in our templating or rules systems. It supports both arrays and objects. +To pass arrays and objects in the query string of a request, you must use the following syntax: + +- for objects: `?param1=test&obj[prop1]=value`. +- for arrays: `?param1=test&array[]=value1&array[]=value2` or `?param1=test&array[0]=value1&array[1]=value2` or `?param1=test&array=value1,value2`. diff --git a/content/docs/v6.1.0/api-endpoints/templates-and-ai-assistant.md b/content/docs/v6.1.0/api-endpoints/templates-and-ai-assistant.md new file mode 100644 index 00000000..bf0ebb16 --- /dev/null +++ b/content/docs/v6.1.0/api-endpoints/templates-and-ai-assistant.md @@ -0,0 +1,69 @@ +--- +title: Templates and AI assistant +meta: + title: Mockoon templates and AI assistant documentation + description: All you need to know about Mockoon's mock API ready to use JSON templates and AI assistant to generate your own dynamic and realistic templates. +order: 220 +proBadge: true +--- + +# Templates and AI assistant + +--- + +## Overview + +Mockoon **templates** are pieces of JSON, often with [templating helpers](docs:templating/overview), that can be used in Mockoon to quickly prototype your mock APIs. They can be used in your [HTTP route's](docs:api-endpoints/routing#api-routes) body or as [data bucket](docs:data-buckets/overview) content to create realistic and dynamic data. + +Two types of templates are available: **pre-generated** and **AI-generated**. + +## Use the pre-generated templates + +The pre-generated templates can be found in the desktop application. + +To use a template in your routes, click on the "From template" entry in the route creation menu to open the templates dialog: + +![modal with templates list{390x304}](docs-img:pre-generated-templates-modal.png) + +Then, select the template you want to use and either copy-paste its content manually or click on one of the two buttons to create a new **GET endpoint** or a **CRUD endpoint with a data bucket**. + +![create get route from template{860x759}](docs-img:templates-create-get-route.png) + +The "GET route" button will create a new HTTP GET route and copy the template content as the body. The "CRUD + data" button will create a new CRUD endpoint with a linked data bucket and copy the template content as the data bucket content. + +> Some templates are offered for free, while most of them require a subscription to [Mockoon Pro](/pro/). The templates part of the Pro plans are marked with a small yellow corner. + +## Use the AI assistant to generate realistic data + +You can also use our AI assistant to generate realistic mock data for your various endpoints by providing a custom prompt. This feature is available in the desktop application and is part of the [Mockoon Pro](/pro/) plans. + +To generate a new template, click the "From template" button in the route creation menu (see above), and select the "Generate" tab: + +![AI assistant generate tab{860x759}](docs-img:ai-assistant-generate-template-tab.png) + +Then, write a prompt (e.g. "list of users") and click the "Generate" button. + +![AI assistant generate button click{860x759}](docs-img:ai-assistant-generate-button.png) + +Finally, you can copy-paste the generated template manually or click on one of the two buttons to create a new **GET endpoint** or a **CRUD endpoint with a data bucket**. + +![create get route from template{860x759}](docs-img:templates-generate-get-route.png) + +### Writing prompts + +Mockoon AI assistant wraps your prompt with various instructions to help you generate the most relevant template for your needs. It has been optimized for the JSON format but can also generate templates in XML, CSV, etc. +Several options are available to fine-tune the generated templates: + +- **JSON**: the generated template will be a valid JSON object. +- **array**: the generated template root level will be a JSON array (usually used with the **JSON** option). +- **templating**: the generated template will contain Handlebars [templating helpers](docs:templating/overview) (e.g. `{{faker 'person.firstName'}}`). Please note that disabling this option usually results in longer templates. + +![prompt options buttons{860x759}](docs-img:ai-assistant-template-generate-options.png) + +You will obtain best results with shorter prompts: "list of users", "JSON configuration for library X", etc. + +If you want more freedom when generating templates (using a different data format, etc.), you can disable the various options. Our system will still manage your prompt to increase the relevance of the generated template. + +### AI assistant quota + +Each use of the AI assistant will count as one credit towards your monthly quota. You can check your quota in your [account page](https://mockoon.com/account/info/). diff --git a/content/docs/v6.1.0/callbacks/overview.md b/content/docs/v6.1.0/callbacks/overview.md new file mode 100644 index 00000000..a839b8b0 --- /dev/null +++ b/content/docs/v6.1.0/callbacks/overview.md @@ -0,0 +1,36 @@ +--- +title: Overview +meta: + title: Callbacks overview + description: Learn how to create callbacks in Mockoon to call webhooks or microservices and how to trigger them from your route responses +order: 650 +--- + +# Callbacks overview + +--- + +## What are callbacks? + +Callbacks are a way to **make one or more HTTP calls** after an entering request reaches your route. This is useful to **call other APIs or micro-services or to trigger a webhook**. + +Callbacks are fully configurable and are created at the environment level, like the [data buckets](docs:data-buckets/overview). + +## Create a callback + +To create a new callback, open the **Callbacks** options by clicking on the tab at the top of the window: + +![click on the callbacks tab at the top{955x160}](docs-img:open-callbacks-view.png) + +Add a new callback by clicking on the "plus" button: + +![Add a new callback by clicking on the plus button{1495x578}](docs-img:add-callback.png) + +## Configure a callback + +The callback configuration interface is very similar to the route response interface. You can configure the callback's **name**, **description**, **method**, **URL**, **body**, and **headers**: + +- **URL**: the URL to call. Supports [templating helpers](docs:templating/overview). +- **Method**: the HTTP method to use for the call. Only some methods support a body (`POST`, `PUT`, and `PATCH`). +- **Body**: the body to send with the call. You can serve an inline body, a file, or the content of a [data bucket](docs:data-buckets/overview). They support templating too. Please refer to the [response body](docs:response-configuration/response-body) documentation for more details. +- **Headers**: the headers to send with the call. They support our [templating helpers](docs:templating/overview). diff --git a/content/docs/v6.1.0/callbacks/using-callbacks.md b/content/docs/v6.1.0/callbacks/using-callbacks.md new file mode 100644 index 00000000..f55c93cf --- /dev/null +++ b/content/docs/v6.1.0/callbacks/using-callbacks.md @@ -0,0 +1,25 @@ +--- +title: Using callbacks +meta: + title: Using callbacks + description: Learn how to use Mockoon's callbacks, link them to your route responses and delay their execution +order: 651 +--- + +# Using callbacks + +--- + +After [creating callbacks](docs:callbacks/overview), you can link them in your route responses and delay their execution. + +## Link a callback to a route response + +To link a callback to a route response, choose "Callbacks" in the route response menu: + +![click on the callbacks tab in the route response menu{1228x153}](docs-img:open-route-response-callbacks.png) + +Then, click on the "plus" button to add a new callback, and select the callback you want to link: + +![click on the plus button to add a new callback{1208x234}](docs-img:link-callback-response.png) + +> 💡 You can **delay a callback execution** by adding a delay in milliseconds in the "Callback latency" field. diff --git a/content/docs/v6.1.0/data-buckets/overview.md b/content/docs/v6.1.0/data-buckets/overview.md new file mode 100644 index 00000000..11b2b141 --- /dev/null +++ b/content/docs/v6.1.0/data-buckets/overview.md @@ -0,0 +1,57 @@ +--- +title: Overview +meta: + title: Data buckets overview + description: Learn what are Mockoon's data buckets, how they work, what type of content is supported and how to create one +order: 600 +--- + +# Data buckets overview + +--- + +## What are data buckets? + +In Mockoon, a data bucket is a **key value store** where you can create reusable content or data for your routes. + +The data buckets are defined at the **environment level** and are **generated when the server starts**. It means that their state **persists between each call** ([see below](#data-buckets-generation)). + +## Create a data bucket + +To create a new data bucket, open the **Data** options by clicking on the tab at the top of the window: + +![Open data bucket view{745x160}](docs-img:open-data-view.png) + +Add a new data bucket by clicking on the "plus" button: + +![Add a data bucket{1495x578}](docs-img:add-data-bucket.png) + +You can change the data bucket title and content on the right part of the screen. +Mockoon will automatically attribute a new **unique ID** to your data bucket. You can use this ID to reference the data using the [`data` helpers](docs:data-buckets/using-data-buckets#using-data-helpers). To retrieve a bucket's unique ID, look in the footer under the data bucket content or right-click on a bucket name in the list and click on "Copy ID to clipboard". + +## Content of a data bucket + +Data buckets can contain any text content. They also support all of Mockoon's [templating helpers](docs:templating/overview) including the [`data` and `dataRaw` helpers](docs:data-buckets/using-data-buckets#using-data-helpers). + +Mockoon will always try to parse the data bucket's content from JSON to allow you to reference only part of it using the `data` helpers and an object path. + +## Combining data buckets + +You can easily combine your data bucket contents by referencing other data buckets using the `dataRaw` helper: + +```json +//data bucket content +{ + "data": { + "id": "{{ dataRaw 'other-data-bucket-content' }}" + } +} +``` + +> ⚠️ However, data buckets are generated in the order they are defined in the environment. As a consequence, you cannot reference a data bucket that is defined **after** the current one. + +## Data buckets generation + +Data buckets are generated when the server starts in the order they are defined in the environment. Their state persist during all mock API calls. To regenerate a data bucket's content, restart the mock server. + +If a data bucket contains [request helpers](docs:templating/mockoon-request-helpers), Mockoon will generate the bucket content only after the first call made to a route using this data bucket (by referencing it directly or using a data helper). It allows you to create bucket "configuration" routes that you can call programmatically with the content you want to reuse in your bucket using the request helpers (`body`, `queryParams`, etc.). diff --git a/content/docs/v6.1.0/data-buckets/using-data-buckets.md b/content/docs/v6.1.0/data-buckets/using-data-buckets.md new file mode 100644 index 00000000..cc1a503c --- /dev/null +++ b/content/docs/v6.1.0/data-buckets/using-data-buckets.md @@ -0,0 +1,37 @@ +--- +title: Using data buckets +meta: + title: Using data buckets + description: Learn how to use Mockoon's data buckets, using the two data and dataRaw helpers, or by directly linking the bucket to a route response +order: 610 +--- + +# Using data buckets + +--- + +After [creating data buckets](docs:data-buckets/overview), you can use them through the `data` templating helpers or by directly referencing them in a route response. + +## Using data helpers + +Two helpers are available: [`data`](docs:templating/mockoon-helpers#data) and [`dataRaw`](docs:templating/mockoon-helpers#dataraw). They work in a similar way to the [`body`](docs:templating/mockoon-request-helpers#body) and [`bodyRaw`](docs:templating/mockoon-request-helpers#bodyraw) helpers. + +They can be used [anywhere templating helpers are supported](docs:templating/overview): body editor, files, headers keys and values, etc., and allow you to partially reuse your data bucket content and compose dynamic responses body easily. + +Both helpers support retrieving the data bucket by its unique ID or name. It also allows you to retrieve only part of the data bucket using an optional object path: + +```handlebars +{{data 'ID_or_name' 'object.path'}} +``` + +> Retrieving data at a specific object path requires that the data bucket content is a valid JSON. + +Head over to the [data helpers' documentation](docs:templating/mockoon-helpers#data) to see more examples. + +## Referencing in a route response + +A data bucket can also be directly linked to a route response. Linking a data bucket will serve the generated data bucket content "as-is". + +To link a data bucket to a route response, choose "Data" in the body selector and select your data bucket. + +![Using data bucket in a route response{1233x464}](docs-img:link-data-bucket-response.png) diff --git a/content/docs/v6.1.0/global-variables/overview.md b/content/docs/v6.1.0/global-variables/overview.md new file mode 100644 index 00000000..95316c3d --- /dev/null +++ b/content/docs/v6.1.0/global-variables/overview.md @@ -0,0 +1,70 @@ +--- +title: Overview +meta: + title: How to use global variables + description: Simulate and mock complex API workflows by sharing data between your mock server routes using global variables +order: 550 +--- + +# Global variables + +--- + +Mockoon offers the possibility to **share data** between your routes using global variables. These variables can be set and accessed using the [`setGlobalVar`](docs:templating/mockoon-helpers#setglobalvar) and [`getGlobalVar`](docs:templating/mockoon-helpers#setglobalvar) helpers at runtime. + +## Global variables scope + +Global variables are **shared** between **all routes** of an environment. Their values are **reset** when the environment is **stopped or restarted**. + +> ⚠️These variables are **not shared between environments**. + +## Global variables support + +Global variables are available [everywhere templating helpers are supported](docs:templating/overview). However, it makes most sense to use them in the **response body**. + +> 💡 While you can use global variables in data buckets, keep in mind that bucket content will be [generated when the server starts](), when global variables are not yet set. + +## Usage + +To set and access global variables, two templating helpers are available. + +### Set a global variable + +To set a global variable, use the `setGlobalVar` helper. This helper takes two arguments: the variable name and its value. You can **dynamically set the parameters** using other helpers. + +Some examples: + +```handlebars +{{setGlobalVar 'varName' 'value'}} +{{setGlobalVar 'varName' (bodyRaw 'id')}} +{{setGlobalVar (queryParam 'param1') (bodyRaw 'id')}} +``` + +> 📘 [Helper documentation](docs:templating/mockoon-helpers#setglobalvar). + +### Get a global variable + +To get a global variable, use the `getGlobalVar` helper. This helper takes two arguments: the variable name and an optional path. You can **dynamically set the parameters** using other helpers and use the fetched data in other helpers. +Some examples: + +```handlebars +{{getGlobalVar 'varname'}} +{{getGlobalVar (bodyRaw 'property')}} +{{getGlobalVar (urlParam 'id')}} + + +{{getGlobalVar 'varName' 'path.to.property'}} +{{getGlobalVar 'varName' 'deep.property\.with\.dot'}} + + +{{getGlobalVar 'varName' '$.array.[*].property'}} + +{{#repeat (getGlobalVar 'varname')}}...{{/repeat}} + +{{#each (getGlobalVar 'varName')}}...{{/each}} + + +{{{stringify (getGlobalVar 'varName')}}} +``` + +> 📘 [Helper documentation](docs:templating/mockoon-helpers#getglobalvar). diff --git a/content/docs/v6.1.0/gui-cheat-sheet.md b/content/docs/v6.1.0/gui-cheat-sheet.md new file mode 100644 index 00000000..9fac9be4 --- /dev/null +++ b/content/docs/v6.1.0/gui-cheat-sheet.md @@ -0,0 +1,53 @@ +--- +title: Mockoon GUI cheat sheet +meta: + title: Mockoon GUI cheat sheet + description: Have a doubt? Not sure how to navigate Mockoon's UI? This cheat sheet listing Mockoon\'s major features is for you! +order: 20 +--- + +# Mockoon GUI cheat sheet + +--- + +Are you discovering Mockoon's GUI or forgot what this button is used for? These cheat sheets are for you! + +> The GUI cheat sheet is also available in PDF version
     Download + +## Main endpoints view + +The **main view** (below) contains your environments (or mock API) list, the environment's endpoints, and the currently selected endpoint and [response](docs:route-responses/multiple-responses). It's the view where you will spend the most time. + +![Mockoon routes view{1200x637}](/images/docs/shared/cheat-sheet/routes-view.png) + +The endpoint's responses configuration (below) lets you manage each endpoint responses list and each response parameter: serving a [file](docs:response-configuration/file-serving), a [body](docs:response-configuration/response-body#body-editor-inline), or a [data bucket](docs:data-buckets/overview), with [rules](docs:route-responses/dynamic-rules) or not, etc. + +![Mockoon responses view{1200x661}](/images/docs/shared/cheat-sheet/responses-view.png) + +At the top of the window, you can access other environment related views: the **environment's headers**, the **data buckets**, the **requests logs**, the **environment's proxy** parameters, and the **environment's settings**. + +## Data buckets view + +The [**data buckets**](docs:data-buckets/overview) view let you create and modify key-value stores that can be [linked to route responses](docs:data-buckets/using-data-buckets#referencing-in-a-route-response) or used with the [`data` helper](docs:data-buckets/using-data-buckets#using-data-helpers). They are persisting between calls and can be regenerated by restarting the server. + +![Mockoon data buckets view{1200x753}](/images/docs/shared/cheat-sheet/databuckets-view.png) + +## Environment's requests logs view + +The **request logging** view is especially useful to debug the entering calls and how Mockoon responded to them. For each, you will find the usual information: path, headers, body, etc. +You can also see if the call has been caught or forwarded through the [proxy](docs:server-configuration/proxy-mode) (if enabled) and [automatically mock](docs:logging-and-recording/auto-mocking-and-recording) entering requests that were not caught. +Each environment (or mock API) has its own entering requests recording. + +![Mockoon logs view{1200x753}](/images/docs/shared/cheat-sheet/logs-view.png) + +## Environment's proxy parameters view + +This view allows you to [enable the proxy mode](docs:server-configuration/proxy-mode) and modify its behavior: removing the API prefix, adding specific headers to the proxied server request or response, etc. + +![Mockoon proxy view{1200x551}](/images/docs/shared/cheat-sheet/proxy-view.png) + +## Environment's settings view + +This view is the place where you can set up global settings for each environment. Changing the environment name, port, or API prefix, [enabling HTTPS and using a custom certificate](docs:server-configuration/serving-over-tls), [handling OPTIONS pre-flight requests automatically](docs:server-configuration/cors), etc. + +![Mockoon settings view{1200x645}](/images/docs/shared/cheat-sheet/settings-view.png) diff --git a/content/docs/v6.1.0/logging-and-recording/auto-mocking-and-recording.md b/content/docs/v6.1.0/logging-and-recording/auto-mocking-and-recording.md new file mode 100644 index 00000000..541dc145 --- /dev/null +++ b/content/docs/v6.1.0/logging-and-recording/auto-mocking-and-recording.md @@ -0,0 +1,33 @@ +--- +title: Auto-mocking and recording +meta: + title: Automatic API mock creation + description: Learn how to automatically mock your API endpoints manually or by recording all the entering requests made to an existing API +order: 710 +--- + +# Automatically create mock routes + +--- + +You can automatically create mock routes from HTTP transactions (request/response). This is especially useful when used in pair with the [proxy mode](docs:server-configuration/proxy-mode) to create a mock API from an existing API. + +## Manually create a mock from a request + +Mockoon offers the possibility to automatically create mocks for entering requests. Click on the "plus" icon on a record to create a route containing the same information (headers, body, etc.): + +![create a route from a log{1445x568}](docs-img:logs-auto-mocking.png) + +## Record your API calls + +Mockoon can also automatically create mock API endpoints every time a request is logged. To activate this feature, click on the "Record" button at the top of the logs view: + +![click on the record button{1445x568}](docs-img:logs-start-recording.png) + +You can record in multiple environments at the same time. A red blinking recording icon will appear next to the environment name to indicate that the recording is active: + +![recording icon{1195x368}](docs-img:logs-recording-in-progress.png) + +The recording will only create a route once, based on the path and HTTP method. + +> The recording mode works best with the [proxy mode](docs:server-configuration/proxy-mode) enabled and intercepting all the entering requests. diff --git a/content/docs/v6.1.0/logging-and-recording/requests-logging.md b/content/docs/v6.1.0/logging-and-recording/requests-logging.md new file mode 100644 index 00000000..e77dde90 --- /dev/null +++ b/content/docs/v6.1.0/logging-and-recording/requests-logging.md @@ -0,0 +1,104 @@ +--- +title: Requests logging +meta: + title: Mock API requests logging + description: Learn how to access requests and responses logs or record your REST API servers calls for easier debugging +order: 700 +--- + +# Requests logging + +--- + +## Accessing the logs + +For easier debugging, Mockoon records all entering requests and all the corresponding outgoing responses for each of your mock API. To access an environment's log, click on the "Logs" tab at the top of the window: + +![click the logs tab{913x160}](docs-img:open-logs.png) + +## Logs content + +The list shows all intercepted requests and how Mockoon answered to them. +Please note that all requests are intercepted, even the `/favicon` request made by the browser. +Each record contains the entering request and the outgoing response information. This includes the complete list of headers, route params, query params, and body in raw format. + +![view the request{1445x568}](docs-img:logs-request.png) + +![view the response{1445x568}](docs-img:logs-response.png) + +The interface is showing truncated bodies for both the request and the response (the truncation length can be adjusted in the settings). You can still view them in full in a separated editor by clicking on **View full body in editor**: + +![click on view full body in editor link{1445x568}](docs-img:logs-view-body.png) + +![body content is showed in a modal{860x663}](docs-img:logs-view-body-modal.png) + +## Logs metadata + +You can also easily see if a request has been caught by Mockoon (record shows a green tick) or has been passed to another URL if the [proxy mode](docs:server-configuration/proxy-mode) is activated (record shows a shield icon): + +![view logs metadata{1445x568}](docs-img:logs-metadata.png) + +## File logging + +Mockoon records all transactions in the [logs file](docs:mockoon-data-files/settings-and-logs#application-logs) in JSON format: + +```json +{ + "app": "mockoon-server", + "level": "info", + "message": "Transaction recorded", + "timestamp": "2023-06-29T09:40:01.772Z" + "environmentName": "Demo API", + "environmentUUID": "6a5ccd5b-fd28-471a-bbdc-cbbd7ea54157", + "requestMethod": "GET", + "requestPath": "/test", + "requestProxied": false, + "responseStatus": 200, +} +``` + +You can also enable full transaction logging in the application settings by checking the "Log the full transactions" checkbox in the settings dialog. + +When using this option, logs will contain the full transaction (request and response) with the same information you can see in the desktop application "Logs" tab: + +```json +{ + "app": "mockoon-server", + "level": "info", + "message": "Transaction recorded", + "timestamp": "2023-06-29T09:02:09.801Z", + "environmentName": "Demo API", + "environmentUUID": "d682bfab-52aa-4ec5-a3a5-853e6d3950cc", + "requestMethod": "GET", + "requestPath": "/test", + "requestProxied": false, + "responseStatus": 200, + "transaction": { + "proxied": false, + "request": { + "body": "{}", + "headers": [{ "key": "accept", "value": "*/*" }], + "method": "GET", + "params": [], + "query": "", + "queryParams": {}, + "route": "/test", + "urlPath": "/test" + }, + "response": { + "body": "{}", + "headers": [ + { "key": "content-type", "value": "application/json; charset=utf-8" } + ], + "statusCode": 200, + "statusMessage": "OK" + }, + "routeResponseUUID": "173e37f8-7edd-4ca4-9244-32ca14eeb158", + "routeUUID": "03a3f8de-7a4e-4dd1-a008-719e6165207c" + } +} +``` + +> ⚠️ Enabling this option will generate a lot of logs and can quickly fill up your disk space. Use it with caution. + +> 🔏 Our logging system will automatically anonymize any credentials present in the `Authorization` or `Proxy-Authorization` headers. diff --git a/content/docs/v6.1.0/mockoon-data-files/data-storage-location.md b/content/docs/v6.1.0/mockoon-data-files/data-storage-location.md new file mode 100644 index 00000000..b1840994 --- /dev/null +++ b/content/docs/v6.1.0/mockoon-data-files/data-storage-location.md @@ -0,0 +1,47 @@ +--- +title: Data storage location +meta: + title: Data storage location + description: Learn where Mockoon's data storage files and application settings are located and how to move them to other folders +order: 900 +--- + +# Data storage location + +--- + +## Locating the files + +Since [v1.16.0](https://github.com/mockoon/mockoon/releases/tag/v1.16.0), Mockoon is storing each mock API's data in a separate file. + +You can locate the folder in which the API data are stored by right-clicking on each environment and selecting **"Show data file in explorer/finder"**: + +![click on show in folder in the context menu{490x309}](docs-img:environment-show-in-folder.png) + +## Moving the files + +You can move the data files to another folder by right-clicking on an environment and selecting **"Move data file to folder"**: + +![click on Move data file to folder in folder in the context menu{490x340}](docs-img:environment-move-to-folder.png) + +> Please note that the environment file will be copied to the new folder, and the original file will **not** be deleted. If you want to delete the original file, you will have to do it manually. + +## Enabling data file watching + +Mockoon can monitor data files' external changes and automatically reload the interface with the new information. This is particularly useful when you are editing the data files with an external editor or pulling changes from a git repository. You can activate this option in the settings: + +![enable file monitoring in the settings{860x770}](docs-img:enable-file-watching.png) + +## Old system (pre v1.16.0) + +Before version 1.16.0, all of your environments were stored in the same `environments.json` file in the **application data folder**. The file was located in your operating system's user folder: + +- Windows: `c:/Users/xxx/AppData/Roaming/mockoon/storage` +- Linux: `~/.config/mockoon/storage` +- macOS: `~/Library/Application Support/mockoon/storage` + +When updating to version 1.16.0, Mockoon automatically migrated the old `environments.json` file (see below) and split it into as many files as you had environments. These files were created in the same `storage` folder with incremental names: `environment-0.json`, `environment-1.json`, etc. + +![one file vs multiple files after the migration{600x252}](/images/docs/shared/storage-migration.png) + +> ⚠️ The automatic migration was dropped in [version 5.0.0](/releases/5.0.0/). If you are updating from v1.15.0, please first update to any version between v1.16.0 and v4.1.0, then to v5.0.0. diff --git a/content/docs/v6.1.0/mockoon-data-files/environment-clipboard-copy.md b/content/docs/v6.1.0/mockoon-data-files/environment-clipboard-copy.md new file mode 100644 index 00000000..850e843c --- /dev/null +++ b/content/docs/v6.1.0/mockoon-data-files/environment-clipboard-copy.md @@ -0,0 +1,35 @@ +--- +title: Copy data to the clipboard +meta: + title: Copy data to the clipboard + description: Learn how to easily share your Mockoon's mock API JSON definitions with your team by copying them to the clipboard and importing them in the application +order: 920 +--- + +# Copy data to the clipboard + +--- + +## Copy an environment or a route JSON to the clipboard + +To copy a specific environment or route's JSON data to the clipboard, right-click on the environment or route and select **Copy to clipboard (JSON)**: + +![Right click on an environment and click on Copy to clipboard (JSON){690x328}](docs-img:export-clipboard-env.png) + +The resulting JSON can be saved in a file and directly opened in the desktop app or used with the CLI. + +## Create a new environment from clipboard's data + +To create a new environment from data present in the clipboard, open the **File** menu and select **New environment from clipboard**: + +![Create new environment from clipboard{802x289}](/images/docs/shared/new-environment-from-clipboard.png) + +You will be prompted to choose a save location for your new environment. + +## Create a new route from clipboard's data + +To create a new route from data present in the clipboard, open the **Routes** menu and select **Add route from clipboard**: + +![Create new route from clipboard{802x289}](/images/docs/shared/new-environment-from-clipboard.png) + +The new route will be added to your active environment's routes. diff --git a/content/docs/v6.1.0/mockoon-data-files/settings-and-logs.md b/content/docs/v6.1.0/mockoon-data-files/settings-and-logs.md new file mode 100644 index 00000000..4dc4b640 --- /dev/null +++ b/content/docs/v6.1.0/mockoon-data-files/settings-and-logs.md @@ -0,0 +1,33 @@ +--- +title: Settings and logs +meta: + title: Settings and logs + description: Learn where Mockoon's desktop application settings and log files are located for each operating system +order: 930 +--- + +# Settings and logs + +--- + +Depending on your operating system, Mockoon's settings and log files are located in different folders. + +## Application settings + +Mockoon's settings are always stored in your operating system's user folder: + +- Windows: `c:/Users/{username}/AppData/Roaming/mockoon/storage` +- Windows Portable: `{PORTABLE_EXECUTABLE_DIR}/mockoon-data/storage` +- Linux: `~/.config/mockoon/storage` +- Linux Snap: `~/snap/mockoon/common` +- macOS: `~/Library/Application Support/mockoon/storage` + +## Application logs + +Mockoon's logs are located in the following folders: + +- Windows: `c:/Users/{username}/AppData/Roaming/mockoon/logs/app.log` +- Windows Portable: `{PORTABLE_EXECUTABLE_DIR}/mockoon-data/logs/app.log` +- Linux: `~/.config/mockoon/logs/app.log` +- Linux Snap: `~/snap/mockoon/common/logs/app.log` +- macOS: `~/Library/Logs/Mockoon/app.log` diff --git a/content/docs/v6.1.0/mockoon-data-files/sharing-mock-api-files.md b/content/docs/v6.1.0/mockoon-data-files/sharing-mock-api-files.md new file mode 100644 index 00000000..bb513a0b --- /dev/null +++ b/content/docs/v6.1.0/mockoon-data-files/sharing-mock-api-files.md @@ -0,0 +1,30 @@ +--- +title: Sharing your mock API files +meta: + title: Sharing your mock API files + description: Learn how to easily share your mock API files with other mockoon users, or use them with the CLI, and setup a git repository +order: 910 +--- + +# Sharing your mock API files + +--- + +> 🆕 Be among the first to experience our new cloud offering with **data synchronization** capabilities by [signing up for our waiting list](/pro/). + +### Sharing a mock API + +Each file can be easily shared with other Mockoon's users, "as-is". After [locating your environment file](docs:mockoon-data-files/data-storage-location#locating-the-files), you can share it with your coworkers by using Git for example. You coworkers can then save the file in any folder and open it directly using the "Open environment" button: + +![open an environment{449x235}](docs-img:open-environment.png) + +### Use a Git-tracked folder + +You can save your environment data files in a Git-tracked folder to make sharing easier. By default, an environment file JSON content is saved pretty-printed to allow comparing changes between two commits. +You can disable pretty printing in the settings: + +![disable pretty printing{860x770}](docs-img:storage-pretty-printing.png) + +### Use a mock API with the CLI + +The CLI is directly [compatible with environment files](https://github.com/mockoon/cli#use-your-mocks-in-the-cli). After locating your environment file, you run them with the CLI using the following command: `mockoon-cli start -d ./path-to-file/environment-data-file.json`. diff --git a/content/docs/v6.1.0/openapi/import-export-openapi-format.md b/content/docs/v6.1.0/openapi/import-export-openapi-format.md new file mode 100644 index 00000000..ab3b4e37 --- /dev/null +++ b/content/docs/v6.1.0/openapi/import-export-openapi-format.md @@ -0,0 +1,29 @@ +--- +title: Import/export in OpenAPI format +meta: + title: Import/export in OpenAPI format + description: Learn how to easily import and export or share with your team your mock API servers and routes using the OpenAPI specification +order: 800 +--- + +# Import/export in OpenAPI format + +--- + +Mockoon supports imports in both OpenAPI v2 (Swagger) and v3 formats. Environments can be exported to OpenAPI version 3. + +### Import environment from an OpenAPI v2 or v3 JSON/YAML file + +To import an environment from a file, open the **Import/export** menu, select **Swagger/OpenAPI** and then **Import Swagger v2/OpenAPI v3 (JSON or YAML)**: + +![Click on Import Swagger v2/OpenAPI v3 (JSON or YAML){812x267}](/images/docs/shared/import-openapi.png) + +### Export an environment to an OpenAPI v3 JSON file + +To export an environment to a JSON file, open the **Import/export** menu, select **Swagger/OpenAPI** and then **Export current environment to OpenAPI v3 (JSON)**: + +![Click on Export current environment to OpenAPI v3 (JSON){812x267}](/images/docs/shared/export-openapi.png) + +### Compatibility + +Compatibility between the OpenAPI specification and Mockoon's features is only partial and detailed in the [next article](docs:openapi/openapi-specification-compatibility). diff --git a/content/docs/v6.1.0/openapi/openapi-specification-compatibility.md b/content/docs/v6.1.0/openapi/openapi-specification-compatibility.md new file mode 100644 index 00000000..34121e93 --- /dev/null +++ b/content/docs/v6.1.0/openapi/openapi-specification-compatibility.md @@ -0,0 +1,30 @@ +--- +title: OpenAPI specification compatibility +meta: + title: OpenAPI specification compatibility + description: Learn more about Mockoon compatibility with the OpenAPI specification and how to easily share your API definitions with your team +order: 810 +--- + +# OpenAPI specification compatibility + +--- + +Importing an OpenAPI specification file in Mockoon can be a good starting point to create a mock from your API definition. And exporting your mock to an OpenAPI specification file is also a way to start an API definition. However, there is currently no equivalent between all the OpenAPI specifications and Mockoon's features: + +- Some of Mockoon's features will be lost when exporting to an OpenAPI specification because they have no equivalent in the specification. It is the case for the [rules system](docs:route-responses/dynamic-rules). +- Some features are not yet exported to an OpenAPI specification: bodies created in Mockoon are not converted to OpenAPI schemas or body examples. +- when importing an OpenAPI specification file, not all properties have equivalents in Mockoon, or some may not be implemented yet. See below for the list of imported information. + +Importing from or exporting to an OpenAPI specification file is a good starting point but not a way to share your mock APIs created with Mockoon. For sharing, we recommend that you directly [share Mockoon's data files](docs:mockoon-data-files/sharing-mock-api-files). +Also, if you want to run your mock API with the [CLI](/cli/), you must use [Mockoon's data files directly](/tutorials/run-mock-api-anywhere-cli/), or you may lose part of your mock's behavior. + +### Supported information + +OpenAPI import and export currently support the following API information: + +- API title. +- Server URL, port, base path (prefix) and protocol. +- Routes paths (including route parameters translated to `/:param`), methods, responses with status code (200, etc.), headers, and descriptions. + +_Import only_: sample responses and JSON bodies are created from OpenAPI schemas and examples during import. diff --git a/content/docs/v6.1.0/response-configuration/file-serving.md b/content/docs/v6.1.0/response-configuration/file-serving.md new file mode 100644 index 00000000..2b3c919f --- /dev/null +++ b/content/docs/v6.1.0/response-configuration/file-serving.md @@ -0,0 +1,65 @@ +--- +title: File serving +meta: + title: Mockoon file serving documentation + description: Serve files as body for your mock API, use the templating system and set relative or absolute paths for easier sharing. +order: 420 +--- + +# File serving + +--- + +Besides using the body editor, Mockoon allows you to serve different files for each route. File serving should be the preferred method when you want to send lots of data. + +## Using files + +To serve a file, you must provide a path in the file input field: + +![fill the file input field{1218x354}](docs-img:file-path.png) + +> When a file path is provided, the body editor content will be ignored. + +## Absolute or relative paths + +You can either provide an absolute path like `/home/username/file.json` or a relative path. Starting with [v1.16.0](https://github.com/mockoon/mockoon/releases/tag/v1.16.0), relative paths are resolved from the environment's file location. You can check the environment's file location by right-clicking on an environment en select "Show in folder" in the contextual menu: + +![show in folder menu entry{490x309}](docs-img:environment-show-in-folder.png) + +> Prior to v1.16.0, relative file paths were resolved from the application executable. This is also supported by the CLI since its version [1.2.0](https://github.com/mockoon/cli/releases/tag/v1.2.0). + +## Templating + +[Templating](docs:templating/overview) is available in both the file content and the file input field. + +### File content templating + +As for the body editor, templating will be parsed inside files for a limited set of MIME types (`application/json`, `text/html`, `text/css`, `text/csv`, `application/javascript`, `application/typescript`, `text/plain`, `application/xhtml+xml`, `application/xml`). You can use all the available templating helpers to generate dynamic mock data. + +Templating can be disabled both for the body editor and the file content. Please refer to the [templating documentation](docs:templating/overview#disable-body-and-file-templating) for more information. + +> **⚡ A note on performances** +> +> Parsing the templating helpers inside big files can be a very intensive task (CPU and memory intensive). All the files in different formats than the one mentioned above will be streamed to improve performances. +> If you need to send big files in one of the above formats but don't need to parse the templating, you can disable it in the route response settings. It will stream the file instead of parsing it and improve the performance. +> ![disable templating in route response{1297x181}](docs-img:route-response-disable-templating.png) + +### File input templating + +Templating is also supported directly in the **file input field**. It allows to dynamically generate the file path using helpers. Please refer to the [templating documentation](docs:templating/overview#file-input-templating) for more information. + +## 404 fallback + +By default, Mockoon will return an error in the body when a file is not found. It will still keep the status code you set up on your route response. You can instead choose to automatically return a 404 by activating an option in the route response settings: + +![tick the 404 fallback checkbox{1297x231}](docs-img:enable-404-fallback.png) + +This option will also fall back to use the content present in the body editor. + +## Serving a range of bytes from a file + +Mockoon supports the `Range` header for files that are not parsed by the templating engine or when the templating is disabled on the response (see [above](#file-content-templating)). + +To use this feature, you must provide a `Range` header in your request. The header value must be in the form `bytes=start-end` where `start` and `end` are the byte positions of the file you want to return. For example, `bytes=0-100` will return the first 100 bytes of the file. + +The server will answer with a `206 Partial Content` status code and the `Content-Range` header containing the range of bytes returned. If the range is invalid, the server will answer with a `416 Range Not Satisfiable` status code. diff --git a/content/docs/v6.1.0/response-configuration/response-body.md b/content/docs/v6.1.0/response-configuration/response-body.md new file mode 100644 index 00000000..61a574d9 --- /dev/null +++ b/content/docs/v6.1.0/response-configuration/response-body.md @@ -0,0 +1,42 @@ +--- +title: Body +meta: + title: Response body + description: Learn how to serve different type of bodies with Mockoon, how to use files or databucket to serve realistic dynamic responses +order: 400 +--- + +# Response body + +--- + +Each [route response](docs:route-responses/multiple-responses) can serve a different body content. You have three possibilities to add a body content to your response: the inline body editor, an external file, or the content of a data bucket. + +You can choose each option using the body selector: + +![body type toggle buttons{1495x540}](docs-img:body-type-toggle.png) + +## Body editor (inline) + +You can use the body editor to directly create your response content. It supports all the [templating helpers](docs:templating/overview). + +![inline body editor{1285x742}](docs-img:inline-body-editor.png) + +> Mockoon will save the content of the inline body editor directly in your [data file](docs:mockoon-data-files/data-storage-location). +> Using an external file could improve the performance for large content. + +## External file + +You can also choose to serve an external file, using the second option: + +![external file linking input{1285x742}](docs-img:body-file-serving.png) + +Please refer to the [file serving documentation](docs:response-configuration/file-serving) for more information. + +## Data bucket + +You can finally choose to serve the content of a data bucket using the third option: + +![data bucket linking select menu{1285x742}](docs-img:body-data-bucket.png) + +Please refer to the [data bucket documentation](docs:data-buckets/overview) for more information. diff --git a/content/docs/v6.1.0/response-configuration/response-headers.md b/content/docs/v6.1.0/response-configuration/response-headers.md new file mode 100644 index 00000000..f24641a1 --- /dev/null +++ b/content/docs/v6.1.0/response-configuration/response-headers.md @@ -0,0 +1,35 @@ +--- +title: Headers +meta: + title: Define route and environment response headers + description: Mockoon can handle response headers at both environment and route levels for your mock server, learn how +order: 410 +--- + +# Headers + +--- + +In Mockoon you can easily define **response headers** for **each route** but also at the **environment level**. Response headers defined on a route will **override** those defined in an environment. + +## Route level response headers + +To add response headers like `Content-Type` to your route, go to the route's **Headers tab** and fill the name and value fields: + +![Complete route response header form{1228x204}](docs-img:fill-route-header-form.png) + +You can add one or more headers by clicking on the "Add header" button at the bottom of the list: + +![Add route response header{1208x234}](docs-img:add-route-header.png) + +## Environment level response headers + +You can also add response headers at the environment level. Headers defined in an environment will be overridden if they are redefined on a route. To define an environment response header: + +Open the **Environment Headers** by clicking on the tab at the top of the window: + +![click on the headers tab{746x160}](docs-img:open-environment-headers.png) + +And add one or more headers by clicking on the "Add header" button at the bottom of the list: + +![Add environment header{1408x137}](docs-img:add-environment-header.png) diff --git a/content/docs/v6.1.0/response-configuration/xml-support.md b/content/docs/v6.1.0/response-configuration/xml-support.md new file mode 100644 index 00000000..43829c5f --- /dev/null +++ b/content/docs/v6.1.0/response-configuration/xml-support.md @@ -0,0 +1,51 @@ +--- +title: XML support +meta: + title: XML support for entering requests + description: Create realistic mock APIs and generate fake data with Mockoon's templating and rules system supporting the XML format +order: 430 +--- + +# XML support + +--- + +When sending a request containing a valid XML body and an `application/xml` or `text/xml` `Content-Type`, Mockoon will parse the XML and allow you to create [body response rules](docs:route-responses/dynamic-rules) or use the [`body` and `bodyRaw` templating helpers](docs:templating/mockoon-request-helpers#body). Mockoon uses the [**xml-js** NPM package](https://www.npmjs.com/package/xml-js) to convert the entering XML. Please note that the **xml-js** package converts XML into JSON in a particular way, as shown below: + +Entering XML body: + +```xml + + +John +Doe + +``` + +JSON equivalent (compacted): + +```json +{ + "_declaration": { + "_attributes": { + "version": "1.0", + "encoding": "utf-8" + } + }, + "user": { + "_attributes": { + "userID": "123" + }, + "firstname": { + "_text": "John" + }, + "lastname": { + "_text": "Doe" + } + } +} +``` + +> 📘 Please refer to [xml-js documentation](https://www.npmjs.com/package/xml-js) for more detail on how the XML is parsed. + +> 🛠️ Use our [XML to JSON converter](/tools/xml-to-json/) to get a preview of how Mockoon will convert your XML to JSON. diff --git a/content/docs/v6.1.0/route-responses/dynamic-rules.md b/content/docs/v6.1.0/route-responses/dynamic-rules.md new file mode 100644 index 00000000..014fa202 --- /dev/null +++ b/content/docs/v6.1.0/route-responses/dynamic-rules.md @@ -0,0 +1,115 @@ +--- +title: Responses rules +meta: + title: Server different responses based on rules + description: Learn how to define multiple route responses for each route and triggered them with rules based on the entering request parameters. +order: 310 +--- + +# Adding response rules + +--- + +After creating [multiple responses](docs:route-responses/multiple-responses) for each route, you can create more complex scenarios and serve the responses depending on the fulfillment of rules. + +## Defining rules + +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{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: + +![Click on add and fill the fields{1218x304}](docs-img:add-route-response-rule.png) + +### Reordering rules + +By default, rules are interpreted in the order you added them. You can change their interpretation order by drag and dropping them: + +![Drag and drop rules to reorder them{1195x326}](docs-img:route-response-rule-reorder.png) + +### Disabling rules + +You can temporarily disable the rules and serve the default response only. To activate this option, click on the "rules" icon next to the response list: + +![Disable rules{1220x244}](docs-img:disable-rules.png) + +> When this option is active, the default response will be always served and all the rules defined on this route will be ignored. Also, this option cannot be selected in addition to the random or sequential responses. + +### Rules logical operator + +Inside a route response, rules are interpreted by default with the OR logical operator. When you have more than one rule in a route response, you can easily switch the operator applied when interpreting the rules, by clicking on the `OR|AND` buttons at the left of the rules: + +![Choose the rule operator OR AND{1213x214}](docs-img:route-response-rules-operator.png) + +Rules have four parts: + +- a **target** +- a **property name or path** +- an **invert operator** toggle +- a comparison **operator** +- a **value** + +### 1. Target + +![Rule target{1238x204}](docs-img:route-response-rules-target.png) + +In the dropdown menu you can choose between: + +- the **body** value (full raw content or one of its properties if request's `Content-Type` is either `application/json`, `application/x-www-form-urlencoded`, `multipart/form-data`, `application/xml`, `application/soap+xml` or `text/xml`). +- the value of a **header**. +- the value of a **cookie**. +- the value of a **route parameter**. +- the value of a **query string field**. +- the **request number** index starting at 1. + +### 2. Property name or path + +![Rule property{1238x204}](docs-img:route-response-rules-property.png) + +Depending on the **target**, the way to access properties may be different: + +- **body**: + - keep empty to match against the full raw body content. + - use a path to access one of its properties. Two syntaxes are supported, [object-path](https://www.npmjs.com/package/object-path) or [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus). When using object-path, properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. + Fetching object properties is compatible with request's bodies of `Content-Type` `application/json`, `application/x-www-form-urlencoded`, `multipart/form-data`, `application/xml`, `application/soap+xml` or `text/xml`. + _Please note that XML bodies are parsed using [xml-js](https://www.npmjs.com/package/xml-js) package. Refer to this [page](docs:response-configuration/xml-support) or the package documentation for more information on how the XML is parsed and how to fetch specific properties._ + _Please also note that `multipart/form-data` only supports fields. Uploaded files will be ignored._ +- **headers**: a header name like `Accept` or `Content-Type`. +- **cookies**: the cookie name like `Session-id`. +- **route param**: a route param name without the colon (":"), `:userId` becoming `userId`. +- **query string**: either provide a property name like `filter` or a path if the query string field is an object `filter.primary`. +- **request number**: _nothing has to be provided here for the request number_. + +For **body** and **query string**, if the property is an array, Mockoon will automatically check in the array if at least one item matches the value. + +### 3. Invert operator + +You can invert the **comparison operator** (**!** equals, **!** regex match, etc.) by toggling on the exclamation mark button: + +![Rule comparison operator{1238x204}](docs-img:route-response-rules-invert-operator.png) + +### 4. Comparison operator + +![Rule comparison operator{1238x204}](docs-img:route-response-rules-comparison-operator.png) + +Multiple comparison operators are available in each rule: + +- **equals**: asserts that the targeted property is equal to the **value**. +- **regex match**: asserts that the targeted property matches the regex **value**. +- **null**: asserts that the targeted property is null or absent (for **headers** or **cookies**). +- **empty array**: asserts that the targeted property is an empty array. + +### 5. Value + +![Rule value{1238x204}](docs-img:route-response-rules-value.png) + +Depending on the comparison operator chosen, **equals** or **regex match**, you can either set a simple text value like "expected value" or any kind of regex. To use a regex, you must write it without the leading and trailing slashes. + +Regex examples: +`primary|secondary`, `^user1-9`, `UTF-.*`. +You can also test for empty values with the following regex: `^$|\s+`. + +The **request number** supports simple entries like `1` or `2` but also regexes, allowing you to return a different response for the first 3 calls `^[1-3]$` or failing on odd request indexes `[13579]$`. + +> 💡 The response rule values also support templating helpers to create dynamic rules. See the [templating helpers](docs:templating/overview) documentation for more information. diff --git a/content/docs/v6.1.0/route-responses/global-routes-with-rules.md b/content/docs/v6.1.0/route-responses/global-routes-with-rules.md new file mode 100644 index 00000000..0ba5bff5 --- /dev/null +++ b/content/docs/v6.1.0/route-responses/global-routes-with-rules.md @@ -0,0 +1,49 @@ +--- +title: Global routes with rules +meta: + title: Define global routes with reusable responses and rules + description: Learn how to define global routes with responses and rules to protect your endpoints. Create reusable responses and rules and apply them to all your routes. +order: 320 +--- + +# Global routes with rules + +--- + +If you want to serve the same responses based on the same rules for all or part of your endpoints, you can create global routes using the **fallback mode** and a **wildcard path**. This is useful if you want to protect all your endpoints by checking if an `Authorization` header is present or if you want to verify that all your requests contain a specific property in their body. + +Three parts are required to create a global route: + +## 1. Create a wildcard route + +To create a global route, you first need to create a new HTTP route that will match all the endpoints you want to protect. To do so, create a new route and select "All methods" in the method dropdown: + +![wildcard route on all methods{599x325}](docs-img:create-wildcard-route.png) + +In this example, the wildcard route is placed above the `GET /users` route, which is important as it will be [evaluated first](docs:api-endpoints/routing#routes-order) and catch all the requests. You can create it first or move it up in the routes list with a drag and drop. + +> 💡 You can also create a wildcard route that only matches a specific method, like `GET` or `POST`, instead of "All methods", if you want to protect all your `POST` endpoints, for example. +> Finally, you can create a wildcard route that matches all the endpoints starting with a specific path, like `/users/*` instead of `/*`. You can use this method to protect all your `/users/something` endpoints but not the `/users` one. + +## 2. Create your global responses and rules + +The second step is to create one or more responses with rules. For example, you can create a response checking that the request contains an `Authorization` header and returning a `401` error if's not present. +To follow this example, use the existing response or create a new one and set the status code to `401`: + +![create response with status code 401{1237x261}](docs-img:response-status-code-401.png) + +Add a new rule to this response by clicking on the "add rule" button and selecting the "Header" rule type. Then, set the rule to check that the `Authorization` header is null as we want to return a `401` error if it is not present: + +![create rule to check that the Authorization header is null{1218x304}](docs-img:response-rule-header-null.png) + +> 💡 You can create more responses with associated rules to verify more criteria on the request and serve different responses accordingly (errors, etc.). + +## 3. Activate the fallback mode + +Once your route is created and your responses customized, activate the fallback mode by clicking on the "fallback" icon next to the response list: + +![Activate fallback mode{1289x174}](docs-img:activate-fallback-mode.png) + +This will automatically pass the request to the next route when none of the [responses' rules](docs:route-responses/dynamic-rules) match. + +> 📘 Learn more about the [fallback mode](docs:route-responses/multiple-responses#fallback-mode) in our documentation. diff --git a/content/docs/v6.1.0/route-responses/multiple-responses.md b/content/docs/v6.1.0/route-responses/multiple-responses.md new file mode 100644 index 00000000..7b3e7030 --- /dev/null +++ b/content/docs/v6.1.0/route-responses/multiple-responses.md @@ -0,0 +1,76 @@ +--- +title: Multiple route responses +meta: + title: Define multiple responses for each route + description: Multiple responses can be defined for each route with different body, headers and status. Learn how to create them and randomize them. +order: 300 +--- + +# Multiple responses + +--- + +For each route, multiple responses can be defined (status, body, and headers) and [triggered using a set of rules](docs:route-responses/dynamic-rules). There is always at least one response when you create a new route. You can modify it and add more responses but you can never delete the last route response. + +## Adding or duplicating a response + +To **add** a new response to your route, click on the "plus" icon next to the responses list: + +![Click on the icon to add a new response{1218x164}](docs-img:add-route-response.png) + +You can also **duplicate** an existing route response by clicking on the "copy" icon on the right: + +![Click on the copy icon to duplicate a response{1185x195}](docs-img:duplicate-route-response.png) + +Everything will be copied to the new response: documentation, file/body, headers and rules. + +## Route responses precedence + +Route responses order define the order in which the [rules are interpreted](docs:route-responses/dynamic-rules). You can easily change the default response by reordering the responses menu with a drag and drop: + +![Reorder route responses{1199x214}](docs-img:reorder-responses.png) + +## Default route response + +Without rules or when a request does not match the one you defined, the default response will always be the one marked with the blue flag. You can easily change the default response by clicking on the grey flags in the menu: + +![Define a new default route response{1183x216}](docs-img:change-route-responses-default.png) + +## Random route response + +Mockoon can serve the route responses randomly (200, 500, 404) to simulate an unpredictable behavior. + +To activate this option, click on the "shuffle" icon next to the response list: + +![Random route responses{1232x174}](docs-img:random-route-responses.png) + +> ⚠️ When this option is active, the [default response](#default-route-response) and all the rules defined on this route will be ignored. Also, this option cannot be selected in addition to the sequential responses option below. + +## Sequential route response + +Mockoon can serve the route responses sequentially (200 → 500 → 404). Mockoon will serve all the responses one after the other and restart at the beginning. The sequence is reset when restarting the server. + +To activate this option, click on the "repeat" icon next to the response list: + +![Sequential route responses{1221x174}](docs-img:sequential-route-responses.png) + +> ⚠️ When this option is active, the [default response](#default-route-response) and all the rules defined on this route will be ignored. Also, this option cannot be selected in addition to the random responses option above. + +## Fallback mode + +When the **fallback mode** is enabled, Mockoon will automatically pass the request to the proxy (or the next route, see below) when none of the [responses' rules](docs:route-responses/dynamic-rules) match. + +To activate this option, click on the "fallback" icon next to the response list: + +![fallback mode responses{1199x174}](docs-img:fallback-mode-responses.png) + +Behind the scene, the server will automatically jump to the next route in the [order](docs:api-endpoints/routing#routes-order) they were declared and, ultimately, to the proxied server. It allows to create complex setups where a wildcard or parameterized route contains rules to protect the access to other routes: + +``` +GET /users/* --> Authorization header required +GET /users/:id --> No rules +``` + +> 💡 Header over to our ["Global routes with rules"](docs:route-responses/global-routes-with-rules) documentation section to learn more about this feature. + +> ⚠️ When this option is active, the [default response](#default-route-response) will be ignored. Also, this option cannot be selected in addition to the other response options above and could result in a 404 if the proxy is not enabled. diff --git a/content/docs/v6.1.0/server-configuration/cors.md b/content/docs/v6.1.0/server-configuration/cors.md new file mode 100644 index 00000000..3a507f6a --- /dev/null +++ b/content/docs/v6.1.0/server-configuration/cors.md @@ -0,0 +1,53 @@ +--- +title: CORS +meta: + title: Automatic handling of CORS preflight OPTIONS requests + description: Front-end application and your JSON mock API are not on the same domain? Handle preflight OPTIONS requests automatically with Mockoon +order: 120 +--- + +# CORS + +--- + +## Automatic handling of CORS preflight requests + +When creating mock APIs, chances are the front-end application and the mocked API won’t be on the **same domain**, thus triggering browsers OPTIONS [preflight requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS). + +For your application to work, you can make Mockoon automatically answer to these OPTIONS requests: + +Open the **Environment Settings** by clicking on the tab at the top of the window: + +![click on the settings tab{1148x160}](docs-img:open-environment-settings.png) + +Enable the **Automatically handle OPTIONS pre-flight requests ** by ticking the checkbox: + +![tick the CORS checkbox{1048x509}](docs-img:enable-cors.png) + +You need to restart the environment for the change to take effect. + +Mockoon will now automatically answer with a 200 HTTP status code to all preflight OPTIONS requests. The following headers will also be added to the response: + +```http +Access-Control-Allow-Origin: * +Access-Control-Allow-Methods: GET,POST,PUT,PATCH,DELETE,HEAD,OPTIONS +Access-Control-Allow-Headers: Content-Type, Origin, Accept,Authorization,Content-Length, X-Requested-With +``` + +Please note that Mockoon won’t send any CORS header on routes with the OPTIONS method (i.e. `OPTIONS /my-route`). + +## Add CORS headers to the environment headers + +You can also add the same CORS headers to all routes of a mock API with one click. + +Open the **Environment Headers** by clicking on the tab at the top of the window: + +![click on the headers tab{1495x160}](docs-img:open-environment-headers.png) + +Then, click on the **Add CORS headers** link: + +![Click on the add CORS headers link{1495x137}](docs-img:add-cors-headers.png) + +The above headers will be automatically added to your list of headers: + +![view cors headers in the list{1495x237}](docs-img:view-cors-headers.png) diff --git a/content/docs/v6.1.0/server-configuration/listening-hostname.md b/content/docs/v6.1.0/server-configuration/listening-hostname.md new file mode 100644 index 00000000..ab3117de --- /dev/null +++ b/content/docs/v6.1.0/server-configuration/listening-hostname.md @@ -0,0 +1,25 @@ +--- +title: Listening hostname/adapter +meta: + title: Listening hostname or adapter + description: Learn how you can customize the hostname or network adapter your mock API will listen to in the desktop application or the CLI +order: 130 +--- + +# Listening hostname/adapter + +--- + +By default, Mockoon's mock APIs will listen to all available network adapters on IPv4 and IPv6, often described as `0.0.0.0` and `::`. Your mock server will be available on all your adapters, such as `localhost`, `127.0.0.1`, your local IPv4 address(es) `192.168.x.x`, `::1`, etc. + +To configure each environment to listen on a specific hostname, open the **Environment Settings** by clicking on the tab at the top of the window: + +![click on the settings tab{1148x160}](docs-img:open-environment-settings.png) + +Add a **custom hostname** in the input field: + +![field to set a custom hostname{1495x213}](docs-img:custom-hostname-setting.png) + +> You may need to restart your environment for the change to take effect. + +> When using the CLI, you can choose a specific adapter to listen to (e.g. `192.168.1.1`) by using the `--hostname` flag with the [`start` command](https://github.com/mockoon/mockoon/tree/main/packages/cli#mockoon-cli-start). diff --git a/content/docs/v6.1.0/server-configuration/proxy-mode.md b/content/docs/v6.1.0/server-configuration/proxy-mode.md new file mode 100644 index 00000000..db86f101 --- /dev/null +++ b/content/docs/v6.1.0/server-configuration/proxy-mode.md @@ -0,0 +1,39 @@ +--- +title: Partial mocking with proxy mode +meta: + title: Partial API mocking with proxy mode + description: Learn how to create a mock REST API to intercept traffic and proxy requests to another JSON REST server with Mockoon +order: 100 +--- + +# Proxy mode + +--- + +## Partially mock APIs using the proxy mode + +Mockoon supports partial mocking of an API endpoints by forwarding the requests that does not match a declared route to the URL of your choice. + +To activate the proxy mode, open the **Environment Proxy** options by clicking on the tab at the top of the window: + +![click on proxy tab{998x160}](docs-img:open-proxy-options.png) + +Enable the proxy mode by checking the box and enter the server URL to which you want to forward the calls. A small shield icon should appear on the right of your environment name indicating that the proxy mode has been enabled: + +![tick the Proxy checkbox{1495x277}](docs-img:enable-proxy.png) + +From now on, all routes that have been defined in Mockoon will be intercepted, and any other request not matching any route path will be forwarded to the server URL you entered in the proxy mode setting. + +## Disable API prefix forwarding + +By default, the API prefix will be part of the path called on the proxied API. You can disable this behavior by ticking the "Remove prefix" checkbox: + +![tick the Proxy no prefix forward checkbox{696x320}](docs-img:proxy-no-forward.png) + +## Proxy headers + +Proxy specific headers can also be added, both to the forwarded request and the response received from the target API. + +![add proxy headers by filling the keys and values{1495x379}](docs-img:proxy-headers.png) + +> **Proxy request headers** will be automatically added to the request sent to the proxied server, while **proxy response headers** are added to the response received from the proxied server. diff --git a/content/docs/v6.1.0/server-configuration/serving-over-tls.md b/content/docs/v6.1.0/server-configuration/serving-over-tls.md new file mode 100644 index 00000000..8c7dd9bb --- /dev/null +++ b/content/docs/v6.1.0/server-configuration/serving-over-tls.md @@ -0,0 +1,39 @@ +--- +title: TLS +meta: + title: Serve a mock API over TLS + description: Need to mock a secured REST API server? Mockoon can also do this by serving over TLS with a self-signed certificate +order: 110 +--- + +# TLS + +--- + +Mockoon supports serving your mock API over TLS with a self-signed certificate by default. You can also provide your certificate and trusted CA certificates. + +## Activate the TLS option + +You can activate the TLSoption for each environment independently. Open the **Environment Settings** by clicking on the tab at the top of the window: + +![click on the settings tab{1148x160}](docs-img:open-environment-settings.png) + +Enable the **TLS option** by ticking the checkbox. The option was successfully activated if a yellow lock is displayed next to the environment name. + +![tick the TLS checkbox{804x343}](docs-img:enable-tls.png) + +> You may need to restart your environment for the change to take effect. + +Your mock API will now be available on `https://localhost:port` instead of `http://localhost:port`. + +Please note that Mockoon is using a self-signed certificate to serve your environment over TLS. + +## Provide your own certificate + +You can also provide your certificate in both PKCS12 or PEM formats by filling out the input fields with the path to the file(s). + +![add certificate path{1495x612}](docs-img:enable-tls-custom-certificate.png) + +Mockoon also supports passphrase-protected keys and custom-trusted CA certificates. As Mockoon is using Node.js' `tls`, you can refer to the [`tls.createSecureContext()` documentation](https://nodejs.org/dist/latest-v16.x/docs/api/tls.html#tlscreatesecurecontextoptions) for a full description of the available options. + +> All the path fields support both absolute and relative paths. Relative paths are resolved from the environment's file location. diff --git a/content/docs/v6.1.0/templating/fakerjs-helpers.md b/content/docs/v6.1.0/templating/fakerjs-helpers.md new file mode 100644 index 00000000..6aebdcd4 --- /dev/null +++ b/content/docs/v6.1.0/templating/fakerjs-helpers.md @@ -0,0 +1,48 @@ +--- +title: Faker.js helpers +meta: + title: Create dynamic responses with templating Faker.js helpers + description: Create realistic mock data for your mock API servers with Mockoon's templating system including Faker.js +order: 504 +--- + +# Faker.js helpers + +--- + +Mockoon implements [Faker.js v8.1.0](https://fakerjs.dev/) library by wrapping most of the available helpers. +Faker.js offers lots of helpers: `location.zipCode`, `location.city`, `location.count`, `person.firstName`, `person.lastName`, `number.int`, `number.float`, `internet.avatar`, `internet.email`, etc. Please have a look at [Faker.js documentation](https://fakerjs.dev/) to learn how to use them. + +## Usage + +All Faker.js helpers must be used with the following syntax: `{{faker 'namespace.method'}}`. +**Examples:** + +```js +{{faker 'location.zipCode'}} +{{faker 'location.city'}} +{{faker 'location.county'}} +{{faker 'person.firstName'}} +... +``` + +Faker.js methods may use two different ways of passing parameters: ordered arguments or options objects. Wrapped in Handlebars helpers, this may result in two different ways of using them: + +```js +// named parameters +{{faker 'number.int' min=0 max=25}} + +// ordered arguments (here count=25) +{{faker 'string.alphanumeric' 25}} +``` + +## Set Faker.js' locale and seed + +Faker.js locale and seed can be defined in the application settings: + +![fakerjs settings{860x770}](docs-img:settings-faker.png) + +The locale and seed can also be set when running your mock using the [CLI's flags](https://github.com/mockoon/mockoon/blob/main/packages/cli/README.md#fakerjs-options) or the [serverless package options](https://github.com/mockoon/mockoon/blob/main/packages/serverless/README.md#options). + +> 📝**A note on Faker.js seeding** +> By providing a seed value, you can generate repeatable **sequences** of fake data. Using seeding will not always generate the same value but rather a predictable sequence. diff --git a/content/docs/v6.1.0/templating/mockoon-helpers.md b/content/docs/v6.1.0/templating/mockoon-helpers.md new file mode 100644 index 00000000..eb416284 --- /dev/null +++ b/content/docs/v6.1.0/templating/mockoon-helpers.md @@ -0,0 +1,1357 @@ +--- +title: Custom helpers +meta: + title: Create dynamic responses with templating helpers + description: "Create dynamic fake data for your mock server with Mockoon's templating helpers. All formats are supported: JSON, CSV, HTML, etc." +order: 501 +--- + +# Mockoon templating helpers + +--- + +In addition to Handlebars' built-in helpers, Mockoon offers the following helpers: + +| Block helpers | Data buckets | +| ------------------- | --------------------- | +| [`repeat`](#repeat) | [`data`](#data) | +| [`switch`](#switch) | [`dataRaw`](#dataraw) | + +| Arrays | Objects | +| ------------------- | ------------------- | +| [`array`](#array) | [`object`](#object) | +| [`oneOf`](#oneof) | | +| [`someOf`](#someof) | | +| [`join`](#join) | | +| [`slice`](#slice) | | +| [`len`](#len) | | +| [`filter`](#filter) | | + +| Math | | Variables | +| ----------------------- | --------------------- | ------------------------------- | +| [`add`](#add) | [`eq`](#eq) | [`setVar`](#setvar) | +| [`subtract`](#subtract) | [`gt`](#gt) | [`getVar`](#getvar) | +| [`multiply`](#multiply) | [`gte`](#gte) | [`setGlobalVar`](#setglobalvar) | +| [`divide`](#divide) | [`lt`](#lt) | [`getGlobalVar`](#getglobalvar) | +| [`modulo`](#modulo) | [`lte`](#lte) | | +| [`ceil`](#ceil) | [`toFixed`](#tofixed) | | +| [`floor`](#floor) | [`round`](#round) | | + +| Strings | | Dates | Misc | +| ------------------------- | ----------------------- | --------------------------------- | ------------------------------- | +| [`includes`](#includes) | [`concat`](#concat) | [`now`](#now) | [`newline`](#newline) | +| [`substr`](#substr) | [`indexOf`](#indexof) | [`dateTimeShift`](#datetimeshift) | [`base64`](#base64) | +| [`lowercase`](#lowercase) | [`parseInt`](#parseint) | [`date`](#date) | [`base64Decode`](#base64decode) | +| [`uppercase`](#uppercase) | [`padStart`](#padstart) | [`time`](#time) | [`objectId`](#objectid) | +| [`split`](#split) | [`padEnd`](#padend) | [`dateFormat`](#dateformat) | | +| [`stringify`](#stringify) | [`eq`](#eq) | | | + +| [Faker.js](docs:templating/fakerjs-helpers) aliases | | | +| --------------------------------------------------- | ----------------------------- | ----------------------- | +| [`int`](#int) | [`street`](#street) | [`hexColor`](#hexcolor) | +| [`float`](#float) | [`city`](#city) | [`guid`](#guid) | +| [`boolean`](#boolean) | [`country`](#country) | [`ipv4`](#ipv4) | +| [`title`](#title) | [`countryCode`](#countrycode) | [`ipv6`](#ipv6) | +| [`firstName`](#firstname) | [`zipcode`](#zipcode) | [`lorem`](#lorem) | +| [`lastName`](#lastname) | [`postcode`](#postcode) | | +| [`company`](#company) | [`lat`](#lat) | | +| [`domain`](#domain) | [`long`](#long) | | +| [`tld`](#tld) | [`phone`](#phone) | | +| [`email`](#email) | [`color`](#color) | | + +## repeat + +Repeat the block content a random number of times if two arguments are provided, or a fixed amount of time if only one argument is provided. Set the `comma` parameter to `false` (default to `true`) to prevent the insertion of new lines and commas by the helper. + +| Parameters/arguments | Type | Description | +| -------------------- | ------- | ------------------ | +| [0] | number | Minimum items | +| 1 | number | Maximum items | +| [comma=true] | boolean | Add trailing comma | + +**Examples** + +```handlebars +{{#repeat 5 10 comma=true}}test{{/repeat}} + + +``` + +## switch + +Select some content depending on a variable. Behaves like a regular switch. + +| Arguments (ordered) | Type | Description | +| ------------------- | ---- | ------------------------------------------------ | +| 0 | any | Value against which the switch matches the cases | + +**Examples** + +```handlebars +{{#switch (urlParam 'id')}} + {{#case '1'}}"John"{{/case}} + {{#case '2'}}"Jack"{{/case}} + {{#default}}"Peter"{{/default}} +{{/switch}} +``` + +## data + +Get the **stringified** value at a given `path` from a [data bucket](docs:data-buckets/overview) selected by **ID or name**. This helper is designed to retrieve data to be served in a response. To reuse the retrieved data with other helpers (`each`, `if`, etc.), use the [`dataRaw` helper](#dataraw) below. + +- The `path` supports two syntaxes, [object-path](https://www.npmjs.com/package/object-path) or [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus). When using object-path, properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. + Please note that a value can be retrieved at the path if the data bucket contains valid JSON. +- Full objects or arrays can be retrieved by the helper and will be stringified. +- The full data bucket content can be fetched when the `path` is omitted (`{{data 'ID'}}`). + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | -------------------------------- | +| 0 | string | ID or name of the data bucket | +| 1 | string | Path to the data bucket property | + +**Examples** + +```handlebars +{{data 'bucketNameOrId'}} + + +{{data 'bucketNameOrId' 'path.to.property'}} +{{data 'bucketNameOrId' 'deep.property\.with\.dot'}} + + +{{data 'bucketNameOrId' '$.array.[*].property'}} +``` + +## dataRaw + +Get the **raw** value (array, object, etc.) at a given `path` from a [data bucket](docs:data-buckets/overview) selected by **ID or name**. This "raw" helper is designed to work with other helpers (`each`, `if`, etc.). To directly use the retrieved data in the response, use [data buckets direct linking](docs:data-buckets/using-data-buckets#referencing-in-a-route-response) or the [`data` helper](#data) above. + +- The `path` supports two syntaxes, [object-path](https://www.npmjs.com/package/object-path) or [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus). When using object-path, properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. + Please note that a value can be retrieved at the path if the data bucket contains valid JSON. +- Primitives and data structures can be retrieved by the helper and reused in other helpers (see example below). +- The full data bucket content (array, object, etc.) can be fetched when the `path` is omitted (`{{dataRaw 'ID'}}`). + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | -------------------------------- | +| 0 | string | ID or name of the data bucket | +| 1 | string | Path to the data bucket property | + +**Examples** + +```handlebars +{{dataRaw 'bucketNameOrId'}} + + +{{dataRaw 'bucketNameOrId' 'path.to.property'}} +{{dataRaw 'bucketNameOrId' 'deep.property\.with\.dot'}} + + +{{dataRaw 'bucketNameOrId' '$.array.[*].property'}} + +{{#each (dataRaw 'bucketNameOrId' 'path.to.array.property')}} + value +{{/each}} + +{{#if (dataRaw 'bucketNameOrId' 'path.to.boolean.property')}} + value +{{/if}} +``` + +## array + +Create an array from the given items. This helper is mostly used with the following helpers: `oneOf`, `someOf`. + +| Arguments (ordered) | Type | Description | +| ------------------- | ---- | -------------------------------- | +| 0..n | any | Value used to populate the array | + +**Examples** + +```handlebars +{{array 'item1' 'item2' 'item3'}} +``` + +## oneOf + +Select a random item in the array passed in parameters. `oneOf` will return the actual value in the array. Set the `stringify` parameter to `true` (default to `false`) to get a JSON stringified result. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------- | -------------------- | +| 0 | any[] | Array of values | +| [1 = false] | boolean | Stringify the result | + +**Examples** + +```handlebars +{{oneOf (array 'item1' 'item2' 'item3')}} +result: item2 +``` + +## someOf + +Return a random number of items from the array passed in parameters, concatenated as a string. Use it with triple curly braces to get a JSON representation. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------- | ----------------------- | +| 0 | any[] | Array of values | +| 1 | number | Minimum number of items | +| 2 | number | Maximum number of items | +| [3 = false] | boolean | Get result as an array | + +**Examples** + +```handlebars +{{someOf (array 'item1' 'item2' 'item3') 1 2}} +result: item1,item2 + + +{{{someOf (array 'item1' 'item2' 'item3') x y true}}} +result: item1,item2 +``` + +## join + +Return a new string by concatenating all the elements in an array. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | --------------- | +| 0 | [] | Array of values | +| 1 | string | Separator | + +**Examples** + +```handlebars +{{join (array 'item1' 'item2' 'item3') '#'}} +result: item1#item2#item3 +``` + +## slice + +Return a copy of a portion of an array from start to end indexes (not included). + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | --------------- | +| 0 | [] | Array of values | +| 1 | number | Start index | +| 2 | number | End index | + +**Examples** + +```handlebars +{{slice (array 'item1' 'item2' 'item3') 0 2}} +result: ['item1', 'item2'] +``` + +## len + +Return an array or string length. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------------ | --------------- | +| 0 | [] \| string | Array or string | + +**Examples** + +```handlebars +{{len (array 'item1' 'item2' 'item3')}} +result: 3 + +{{len 'hello'}} +result: 5 +``` + +## filter + +Return a filtered array. This helper can be used with data buckets, use the [dataRaw](#dataraw) for that. + +| Arguments (ordered) | Type | Description | +| ------------------- | ---------------------------- | ------------------- | +| 0 | any[] | Input array | +| 1..n | primitive or object or array | OR conditions level | + +- The first argument is the array to be filtered. +- Each argument starting from index 1 is a condition `filter (array 1 2 3) 1 3 5 6 ....`. + - Condition can be primitives (string, number), [objects](#object) or [arrays](#array) with sub-conditions. + - When the condition is an object, then all keys and values work as an `AND`. + - Conditions support infinite nesting of conditions using arrays. + - The first level of filer arguments works as OR conditions `filter (array 1 2 3) 1 3` equals fo `[1,2,3].filter(x => x === 3 || x === 1)`. + - The second level of conditions works as `AND` sub-conditions list. + - The third level of conditions works as `OR` sub-conditions list. + - Nesting of conditions matches the rule `OR` (the first level of the arguments) -> `AND` -> `OR` -> `AND` -> ... + - For a better understanding of how to build `AND` queries with objects please check the [object helper](#object) documentation. + +**Structure** + +```handlebars + +{{ filter (array 1 2 3 ... ) c1 c2 c3 ... }} +result: c1 OR c2 OR c3 + + +{{ filter (array x y z) (array c1 c2 c3) }} +result: items that fit to c1 AND c2 AND c3 + + +{{ filter (array x y z) (array a1 a2 a3) (array b1 b2 b3) (array c1 c2 c3) }} +result: (a1 AND a2 AND a3) OR (b1 AND b2 AND b3) OR (c1 AND c2 AND c3) + + +{{ filter (array 1 2 3) (array a1 a2 (array x1 x2) ) (array b1 b2 b3) }} +results: items that fit to (a1 AND a2 AND (x1 OR x2) ) OR (b1 AND b2 AND b3) +``` + +**Examples** + +```handlebars + +{{filter (array 1 2 3) 1 3}} +result: 1,3 + + +{{filter (array 'item1' 'item2' 'item3' 'item4' 'item3') 'item1' 'item2' 'item3'}} +result: item1,item2,item3,item3 + + +{{filter (dataRaw 'Users') (object type='item1')}} + + +{{filter (dataRaw 'Users') (object type='item1') (object type='item2') (object type='item3')}} + + +{{filter (dataRaw 'Users') (object type='item1' category='some-category')}} + + +{{filter (dataRaw 'Users') (array (object type='item1') (object category='some-category'))}} + + +{{filter (array 'item1' 'item2' (object type='type1') (object type='type2')) 'item1' (object type='type2')}} +``` + +## object + +Return an object that can be used in other helpers. + +| Parameters (named) | Type | Description | +| ------------------ | ---- | ------------------------------------------- | +| [string]=any | any | key=value notation of the object properties | + +**Examples** + +```handlebars +{{{object type='item1'}}} +result: {type: 'item1'} + +{{{object type='item1' category='cat1'}}} +result: {type: 'item1', category: 'cat1'} + +{{{object type=(array 1 2 3)}}} +result: {type: [1,2,3]} + +{{{object type=(array 1 2 3)}}} +result: {type: [1,2,3]} + +{{{object type=(filter (array 1 2 3) 1 3)}}} +result: {type: [1,3]} +``` + +## add + +Add the numbers passed as parameters to each others. Unrecognized strings passed as arguments will be ignored. + +| Arguments (ordered) | Type | Description | +| ------------------- | ----- | -------------------------------------------------------- | +| 0..n | any[] | Value of the operandes (can process numbers and strings) | + +**Examples** + +```handlebars +{{add 1 1}} +result: '2' + +{{add '1' '1'}} +result: '2' + +{{add '1' 'foo' 1}} +result: '2' +``` + +## subtract + +Subtract the numbers passed as parameters to the first parameter. Unrecognized strings passed as arguments will be ignored. + +| Arguments (ordered) | Type | Description | +| ------------------- | ----- | -------------------------------------------------------- | +| 0..n | any[] | Value of the operandes (can process numbers and strings) | + +**Examples** + +```handlebars +{{subtract 2 1}} +result: '1' + +{{subtract '2' '1'}} +result: '1' + +{{subtract '2' 'foo' 1}} +result: '1' +``` + +## multiply + +Multiply the numbers passed as parameters to each others. Unrecognized strings passed as arguments will be ignored. + +| Arguments (ordered) | Type | Description | +| ------------------- | ----- | -------------------------------------------------------- | +| 0..n | any[] | Value of the operandes (can process numbers and strings) | + +**Examples** + +```handlebars +{{multiply 2 3}} +result: '6' + +{{multiply '2' '3'}} +result: '6' + +{{multiply '2' 'foo' 3}} +result: '6' +``` + +## divide + +Divide the first parameter by the other numbers passed as parameters. Unrecognized strings passed as arguments will be ignored. + +| Arguments (ordered) | Type | Description | +| ------------------- | ----- | -------------------------------------------------------- | +| 0..n | any[] | Value of the operandes (can process numbers and strings) | + +**Examples** + +```handlebars +{{divide 4 2}} +result: '2' + +{{divide '4' '2'}} +result: '2' + +{{divide '4' 'foo' 2}} +result: '2' +``` + +## modulo + +Compute the modulo of the first parameter by the second. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | ---------------------------------------------- | +| 0 | number | First value (can process numbers and strings) | +| 1 | number | Second value (can process numbers and strings) | + +**Examples** + +```handlebars +{{modulo 5 4}} +result: '1' + +{{modulo '5' '4'}} +result: '1' + +{{modulo '5' 'foo' 4}} +result: '1' +``` + +## ceil + +Ceil the value of the number passed as parameter. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | ----------------------------------------------- | +| 0 | number | Value to ceil (can process numbers and strings) | + +**Examples** + +```handlebars +{{ceil 1.5}} +result: '2' + +{{ceil '1.5'}} +result: '2' +``` + +## floor + +Floor the value of the number passed as parameter. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | ------------------------------------------------ | +| 0 | number | Value to floor (can process numbers and strings) | + +**Examples** + +```handlebars +{{floor 2.5}} +result: '2' + +{{floor '2.5'}} +result: '2' +``` + +## eq + +Verify if two numbers or strings are equal. Returns a boolean. +Returns false if type of the value not equals. + +| Arguments (ordered) | Type | Description | +| ------------------- | ---------------- | ----------------------- | +| 0 | string \| number | First number or string | +| 1 | string \| number | Second number or string | + +**Examples** + +```handlebars +{{#if (eq 55 55)}} + true +{{/if}} +Result: true + +{{#if (eq 55 '55')}} + true +{{else}} + false +{{/if}} +Result: false + +{{#if (eq 'x1' 'x1')}} + true +{{/if}} +Result: true +``` + +## gt + +Verify if the first number is greater than the second number. Returns a boolean. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | ------------- | +| 0 | number | First number | +| 1 | number | Second number | + +**Examples** + +```handlebars +{{#if (gt 56 55)}} + true +{{/if}} +Result: true +``` + +## gte + +Verify if the first number is greater than or equal to the second number. Returns a boolean. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | ------------- | +| 0 | number | First number | +| 1 | number | Second number | + +**Examples** + +```handlebars +{{#if (gte 55 55)}} + true +{{/if}} +Result: true +``` + +## lt + +Verify if the first number is lower than the second number. Returns a boolean. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | ------------- | +| 0 | number | First number | +| 1 | number | Second number | + +**Examples** + +```handlebars +{{#if (lt 55 56)}} + true +{{/if}} +Result: true +``` + +## lte + +Verify if the first number is lower than or equal to the second number. Returns a boolean. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | ------------- | +| 0 | number | First number | +| 1 | number | Second number | + +**Examples** + +```handlebars +{{#if (lte 55 55)}} + true +{{/if}} +Result: true +``` + +## toFixed + +Format a number using fixed-point notation. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | ---------------- | +| 0 | number | A number | +| 1 | number | Number of digits | + +**Examples** + +```handlebars +{{toFixed 1.11111 2}} +Result: 1.11 +``` + +## round + +Return the value of a number rounded to the nearest integer. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | ----------------- | +| 0 | number | A number to round | + +**Examples** + +```handlebars +{{round 0.499}} +Result: 0 +``` + +## newline + +Add a newline `\n`. + +**Examples** + +```handlebars +{{newline}} +``` + +## base64 + +Encode the parameter as base64. This can be used as an inline helper or block helper (see examples below). + +| Arguments (ordered) | Type | Description | +| ------------------- | ---- | ------------------------------------------------------ | +| [0] | any | Value to encode (optional when used as a block helper) | + +**Examples** + +```handlebars +{{base64 'test'}} + +{{#base64}} + firstname,lastname,countryCode + {{#repeat 10}} + {{faker 'person.firstName'}},{{faker 'person.lastName'}},{{faker 'address.countryCode'}} + {{/repeat}} +{{/base64}} +``` + +## base64Decode + +Decode a base64 string. This can be used as an inline helper or block helper (see examples below). + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | -------------------------------------------------------------- | +| [0] | string | Base64 string to decode (optional when used as a block helper) | + +**Examples** + +```handlebars +{{base64Decode 'YWJjZA=='}} + +{{#base64Decode}} + {{body 'base64content'}} +{{/base64Decode}} +``` + +## objectId + +Create a valid ObjectId. It can generates the ObjectId based on the specified time (in seconds) or from a 12 byte string that will act as a seed. Syntax is based on [bson-objectid package](https://www.npmjs.com/package/bson-objectid). + +| Arguments (ordered) | Type | Description | +| ------------------- | ---------------- | ----------- | +| 0 | string \| number | Seed | + +**Examples** + +```handlebars +{{objectId 1414093117}} +{{objectId '54495ad94c934721ede76d90'}} +``` + +## setVar + +Set a variable to be used later in the template. The value can be the result of another helper. To use it elsewhere in the template, refer to the variable with its name prefixed with an `@`: `{{@varname}}`. The variable can also be used as a helper parameter: `{{#repeat @varname}}...{{/repeat}}`. +Variables declared in a block helper will be scoped to the block and unavailable outside. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | -------------- | +| 0 | string | Variable name | +| 1 | any | Variable value | + +**Examples** + +```handlebars +{{setVar 'varname' 'value'}} +{{setVar 'varname' (body 'id')}} + +usage: +{{@varname}} +{{#repeat @varname}}...{{/repeat}} + +declare a variable in a block helper: +{{#repeat 5}} + {{setVar 'random' (oneOf (array '1' '2' '3'))}} + {{@random}} +{{/repeat}} + +{{setVar 'myArray' (array '1' '2' '3')}} +{{#each @myArray}} + {{setVar 'eachIndex' @index}} + {{@eachIndex}} +{{/repeat}} +``` + +## getVar + +Dynamically get a variable set with [`setVar`](#setvar). + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | ------------- | +| 0 | string | Variable name | + +**Examples** + +```handlebars +{{setVar 'varname' 'value'}} + +{{getVar 'varname'}} +{{getVar (concat 'var' 'name')}} +{{getVar (body 'property')}} +``` + +## setGlobalVar + +Set a global variable to be used anywhere templating is supported (body, headers, etc.). Global variables are available on all the routes of an environment and they are reset when the environment is restarted. + +- The variable name and values can be dynamically created using other helpers. +- The variable can store any kind of data (arrays, objects, string, etc.). +- To get the value of a global variable, use the [`{{getGlobalVar 'varName'}}` helper below](#getglobalvar). + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | -------------- | +| 0 | string | Variable name | +| 1 | any | Variable value | + +**Examples** + +```handlebars +{{setGlobalVar 'varName' 'value'}} +{{setGlobalVar 'varName' (bodyRaw 'id')}} +{{setGlobalVar (queryParam 'param1') (bodyRaw 'id')}} +``` + +## getGlobalVar + +Get a global variable's value set with [`setGlobalVar`](#setglobalvar). Global variables are available on all the routes of an environment and they are reset when the environment is restarted. + +- The variable name and path can be dynamically created using other helpers. +- The `path` supports two syntaxes, [object-path](https://www.npmjs.com/package/object-path) or [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus). When using object-path, properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. + Please note that a value can be retrieved at the path if the variable contains valid JSON. +- Primitives and data structures can be retrieved by the helper and reused in other helpers (see example below). +- The full variable content (array, object, etc.) can be fetched when the `path` is omitted (`{{getGlobalVar 'varname'}}`). + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | -------------------------- | +| 0 | string | Variable name | +| 1 | string | Path to the value property | + +**Examples** + +```handlebars +{{getGlobalVar 'varname'}} +{{getGlobalVar (bodyRaw 'property')}} +{{getGlobalVar (urlParam 'id')}} + + +{{getGlobalVar 'varName' 'path.to.property'}} +{{getGlobalVar 'varName' 'deep.property\.with\.dot'}} + + +{{getGlobalVar 'varName' '$.array.[*].property'}} + +{{#repeat (getGlobalVar 'varname')}}...{{/repeat}} + +{{#each (getGlobalVar 'varName')}}...{{/each}} + + +{{{stringify (getGlobalVar 'varName')}}} +``` + +## includes + +Search whether a string can be found in another string and returns the appropriate boolean. + +| Arguments (ordered) | Type | Description | +| ------------------- | ---- | ------------------- | +| 0 | any | Data to search into | +| 1 | any | Data to search | + +**Examples** + +```handlebars +{{includes 'Some data' 'data'}} + +result: true +``` + +## substr + +Return a portion of a string starting at the specified index and extending for a given number of characters afterwards. + +| Arguments (ordered) | Type | Description | +| ------------------- | ---- | -------------- | +| 0 | any | Starting index | +| [1 = max length] | any | Length | + +**Examples** + +```handlebars +{{substr 'Some data' 5 4}} + +result: 'data' +``` + +## lowercase + +Return the first string parameter lowercased. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | ------------------- | +| 0 | string | String to lowercase | + +**Examples** + +```handlebars +{{lowercase 'ABCD'}} + +result: 'abcd' +``` + +## uppercase + +Return the first string parameter uppercased. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | ------------------- | +| 0 | string | String to uppercase | + +**Examples** + +```handlebars +{{uppercase 'abcd'}} + +result: 'ABCD' +``` + +## split + +Split a string and return an array containing the multiples substrings. This helper can be used within handlebars' iterative helpers such as `each`. (Default separator is " ") + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | ------------- | +| 0 | string | Data to split | +| 1 | string | Separator | + +**Examples** + +```handlebars +{{#each (split '1 2 3 4')}} + item{{this}}, +{{/each}} +result: item1,item2,item3,item4 + +{{#each (split 'This is my string.')}} + {{this}}, +{{/each}} +result: This,is,my,string, +``` + +## stringify + +Return objects and arrays as a formatted JSON string indented with two spaces. + +| Arguments (ordered) | Type | Description | +| ------------------- | ---- | --------------- | +| 0 | any | Object or array | + +**Examples** + +Considering an entering body: + +```json +{ + "prop1": "123", + "prop2": { + "data": "test" + } +} +``` + +```handlebars +{{{stringify (bodyRaw 'prop2')}}} +``` + +```json +{ + "data": "test" +} +``` + +## concat + +Concatenate multiple strings/numbers together. This helper can concatenate results from other helpers, or be used as a parameter of another helper (see examples below). + +| Arguments (ordered) | Type | Description | +| ------------------- | ---- | --------------------- | +| 0..n | any | Values to concatenate | + +**Examples** + +```handlebars +{{concat 'value1' 2 'value3'}} +{{concat @index (body 'id') 'value3'}} +{{#repeat (concat 1 2 3)}}...{{/repeat}} +``` + +## indexOf + +Return the index of the searched 'data' inside the string. A last parameter (number) can be passed to start the search at a specific index. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | --------------------- | +| 0 | any | Data to search into | +| 1 | any | Data to search | +| [2 = 0] | number | Search starting index | + +**Examples** + +```handlebars +{{indexOf 'Some data' 'data' 0}} + +result: 5 +``` + +## parseInt + +Parse a number from a string. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | --------------- | +| 0 | string | String to parse | + +## padStart + +Pads a string with a given string (repeated, if needed) until the resulting string reaches the given length. The padding is applied from the start of the string. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | --------------------------------------------- | +| 0 | string | String to pad | +| 1 | number | pad length | +| [2 = ' '] | string | Padding character(s) (default to blank space) | + +```handlebars +{{padStart '5' 5 '0'}} + +result: 00005 +``` + +## padEnd + +Pads a string with a given string (repeated, if needed) until the resulting string reaches the given length. The padding is applied from the end of the string. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | --------------------------------------------- | +| 0 | string | String to pad | +| 1 | number | pad length | +| [2 = ' '] | string | Padding character(s) (default to blank space) | + +**Examples** + +```handlebars +{{padEnd '5' 5 '0'}} + +result: 50000 +``` + +## now + +Display the current time in the chosen format. Format syntax is based on [date-fns package (v2)](https://date-fns.org/v2.11.1/docs/format) and is optional (default to ISO string). + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | ----------- | +| 0 | string | Date format | + +**Examples** + +```handlebars +{{now 'YYYY-MM-DD'}} +``` + +## dateTimeShift + +Shift a date by adding the number of `years`, `months`, etc. passed as parameters. The `date` and `format` parameters are optional. The helper will return the current date and time as an ISO string if omitted (`yyyy-MM-ddTHH:mm:ss.SSSxxx`). + +| Parameters (named) | Type | Description | +| --------------------------------------- | ------ | -------------------------- | +| date | string | Date to shift | +| [format = 'yyyy-MM-ddTHH:mm:ss.SSSxxx'] | string | Format of the shifted date | +| [years = 0] | number | Years to shift | +| [months = 0] | number | Months to shift | +| [days = 0] | number | Days to shift | +| [hours = 0] | number | Hours to shift | +| [minutes = 0] | number | Minutes to shift | +| [seconds = 0] | number | Seconds to shift | + +**Examples** + +```handlebars +{{dateTimeShift date='2021-01-01' format='yyyy-MM-dd HH:mm:ss' years=1 months=1 days=1 hours=1 minutes=1 seconds=1}} +``` + +## date + +Return a random formatted date (using [date-fns package format](https://date-fns.org/docs/format)) between a minimum and a maximum. Uses `faker 'date.between'` to generate the random date. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | ------------- | +| 0 | string | Starting date | +| 1 | string | Ending date | +| 2 | string | Date format | + +**Examples** + +```handlebars +{{date '2020-11-20' '2020-11-25' "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"}} +``` + +## time + +Return a random formatted time (using [date-fns package format](https://date-fns.org/docs/format)) between a minimum and a maximum. Uses `faker 'date.between'` to generate the random time. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | ------------- | +| 0 | number | Starting time | +| 1 | number | Ending time | +| 2 | string | Time format | + +**Examples** + +```handlebars +{{time '09:00' '10:00' 'HH:mm'}} +``` + +## dateFormat + +Return a formatted date (using [date-fns package format](https://date-fns.org/docs/format)). + +| Arguments (ordered) | Type | Description | +| ------------------- | -------------- | -------------- | +| 0 | string \| Date | Date to format | +| 1 | string | Output format | + +**Examples** + +```handlebars +{{dateFormat '2021-01-01' 'yyyy'}} +{{dateFormat (faker 'date.recent') 'yyyy'}} +``` + +## int + +Return a random integer. Alias of `faker 'number.int`. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | ----------- | +| 0 | number | Minimum | +| 1 | number | Maximum | + +**Examples** + +```handlebars +{{int 0 100}} +``` + +## float + +Return a random float. Alias of `faker 'number.float` with precision = 10. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | ----------- | +| 0 | number | Minimum | +| 1 | number | Maximum | + +**Examples** + +```handlebars +{{float 0 100}} +``` + +## boolean + +Return a random boolean. Alias of `faker 'datatype.boolean'`. + +**Examples** + +```handlebars +{{boolean}} +``` + +## title + +Return a random title. Alias of `faker 'name.prefix'`. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | ----------- | +| 0 | string | Sex | + +**Examples:** + +```handlebars +{{title 'male'}} +``` + +## firstName + +Return a random first name. Alias of `faker 'person.firstName'`. + +**Examples:** + +```handlebars +{{firstName}} +``` + +## lastName + +Return a random last name. Alias of `faker 'person.lastName'`. + +**Examples:** + +```handlebars +{{lastName}} +``` + +## company + +Return a random company name. Alias of `faker 'company.companyName'`. + +**Examples:** + +```handlebars +{{company}} +``` + +## domain + +Return a random domain name. Alias of `faker 'internet.domainName'`. + +**Examples:** + +```handlebars +{{domain}} +``` + +## tld + +Return a random top level domain. Alias of `faker 'internet.domainSuffix'`. + +**Examples:** + +```handlebars +{{tld}} +``` + +## email + +Return a random email address. Alias of `faker 'internet.email'`. + +**Examples:** + +```handlebars +{{email}} +``` + +## street + +Return a random address. Alias of `faker 'location.streetAddress'`. + +**Examples:** + +```handlebars +{{street}} +``` + +## city + +Return a random city name. Alias of `faker 'location.city'`. + +**Examples:** + +```handlebars +{{city}} +``` + +## country + +Return a random country name. Alias of `faker 'location.country'`. + +**Examples:** + +```handlebars +{{country}} +``` + +## countryCode + +Return a random country code. Alias of `faker 'location.countryCode'`. + +**Examples:** + +```handlebars +{{countryCode}} +``` + +## zipcode + +Return a random zip code. Alias of `faker 'location.zipCode'`. + +**Examples:** + +```handlebars +{{zipcode}} +``` + +## postcode + +Return a random zip code. Alias of `faker 'location.zipCode'`. + +**Examples:** + +```handlebars +{{postcode}} +``` + +## lat + +Return a random latitude. Alias of `faker 'location.latitude'`. + +**Examples:** + +```handlebars +{{lat}} +``` + +## long + +Return a random longitude. Alias of `faker 'location.longitude'`. + +**Examples:** + +```handlebars +{{long}} +``` + +## phone + +Return a random phone number. Alias of `faker 'phone.number'`. + +**Examples:** + +```handlebars +{{phone}} +``` + +## color + +Return a random color. Alias of `faker 'color.human'`. + +**Examples:** + +```handlebars +{{color}} +``` + +## hexColor + +Return a random hexadecimal color code. + +**Examples:** + +```handlebars +{{hexColor}} +``` + +## guid + +Return a random GUID. Alias of `faker 'string.uuid'`. + +**Examples:** + +```handlebars +{{guid}} +``` + +## ipv4 + +Return a random IP v4. Alias of `faker 'internet.ip'`. + +**Examples:** + +```handlebars +{{ipv4}} +``` + +## ipv6 + +Return a random IP v6. Alias of `faker 'internet.ipv6'`. + +**Examples:** + +```handlebars +{{ipv6}} +``` + +## lorem + +Return random lorem ipsum text. Alias of `faker 'lorem.sentence'`. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | --------------- | +| 0 | number | Number of words | + +**Examples:** + +```handlebars +{{lorem 50}} +``` diff --git a/content/docs/v6.1.0/templating/mockoon-request-helpers.md b/content/docs/v6.1.0/templating/mockoon-request-helpers.md new file mode 100644 index 00000000..1e435077 --- /dev/null +++ b/content/docs/v6.1.0/templating/mockoon-request-helpers.md @@ -0,0 +1,253 @@ +--- +title: Request helpers +meta: + title: Create dynamic responses with templating request helpers + description: "Create dynamic fake mock data for your mock environments with Mockoon's templating request helpers. All formats are supported: JSON, CSV, HTML, etc." +order: 502 +--- + +# Templating request helpers + +--- + +Mockoon offers the following helpers which can return information relative to the entering request: + +- [`body`](#body) +- [`bodyRaw`](#bodyraw) +- [`queryParam`](#queryparam) +- [`queryParamRaw`](#queryparamraw) +- [`urlParam`](#urlparam) +- [`cookie`](#cookie) +- [`header`](#header) +- [`hostname`](#hostname) +- [`ip`](#ip) +- [`method`](#method) +- [`baseUrl`](#baseurl) + +## body + +Get the value at a given `path` from the request body if the entering `Content-Type` is set to `application/json`, `application/x-www-form-urlencoded`, `multipart/form-data`, `application/xml`, `application/soap+xml` or `text/xml`. This helper is designed to retrieve data to be served in a response. To reuse the retrieved data with other helpers (`each`, `if`, etc.), use the [`bodyRaw` helper](#bodyraw) below. + +- The `path` supports two syntaxes, [object-path](https://www.npmjs.com/package/object-path) or [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus). When using object-path, properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. + Please note that XML bodies are parsed using [xml-js](https://www.npmjs.com/package/xml-js) package. Refer to this [page](docs:response-configuration/xml-support) or the package documentation for more information on how the XML is parsed and how to fetch specific properties. + Please also note that `multipart/form-data` only supports fields. Uploaded files will be ignored. +- Full objects or arrays can be retrieved by the helper. +- The full request's raw body can also be fetched when the `path` is omitted (`{{body}}`) independently from the request's `Content-Type`. +- If no value is present at the requested `path`, the default value will be used. +- A third parameter (boolean) can be set to true to returns a stringified value even if it's a primitive. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------- | -------------------------------------- | +| 0 | string | Path to the body property | +| 1 | string | Default value if property is not found | +| 2 | boolean | Stringify primitive values | + +**Examples** + +```handlebars +{{body}} + + +{{body 'path.to.property'}} +{{body 'deep.property\.with\.dot'}} + + +{{body '$.array.[*].property'}} + +{{body 'path' 'default value'}} +{{body 'path' 'default value' true}} +``` + +## bodyRaw + +Get the **raw** value at a given `path` from the request body if the entering `Content-Type` is set to `application/json`, `application/x-www-form-urlencoded`, `multipart/form-data`, `application/xml`, `application/soap+xml` or `text/xml`. This "raw" helper is designed to work with other helpers (`each`, `if`, etc.). To directly use the retrieved data in the response, use the [`body` helper](#body) above. + +- The `path` supports two syntaxes, [object-path](https://www.npmjs.com/package/object-path) or [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus). When using object-path, properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. + Please note that XML bodies are parsed using [xml-js](https://www.npmjs.com/package/xml-js) package. Refer to this [page](docs:response-configuration/xml-support) or the package documentation for more information on how the XML is parsed and how to fetch specific properties. + Please also note that `multipart/form-data` only supports fields. Uploaded files will be ignored. +- Full objects or arrays can be retrieved by the helper. +- The full request's raw body can also be fetched when the `path` is omitted (`{{bodyRaw}}`) independently from the request's `Content-Type`. +- If no value is present at the requested `path`, the default value will be used. +- This helper allows the use of `body` within handlebars' helpers such as `{{#each}}` and `{{#if}}`. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | -------------------------------------- | +| 0 | string | Path to the body property | +| 1 | string | Default value if property is not found | + +**Examples** + +```handlebars +{{bodyRaw}} + + +{{bodyRaw 'path.to.property'}} +{{bodyRaw 'deep.property\.with\.dot'}} + + +{{bodyRaw '$.array.[*].property'}} + +{{bodyRaw 'path' 'default value'}} + +{{#each (bodyRaw 'path.to.array.property' 'default value')}} + value +{{/each}} + +{{#if (bodyRaw 'path.to.boolean.property' 'default value')}} + value +{{/if}} +``` + +## queryParam + +Get the value at a given `path` from the request's query string. Complex query strings with arrays and objects are supported. This helper is designed to retrieve data to be served in a response. To reuse the retrieved data with other helpers (`each`, `if`, etc.), use the [`queryParamRaw` helper](#queryparamraw) below. + +- The `path` supports two syntaxes, [object-path](https://www.npmjs.com/package/object-path) or [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus). When using object-path, properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. +- Full objects or arrays can be retrieved by the helper. +- The full query string object can also be fetched when the `path` is omitted (`{{queryParam}}`). It will be stringified and can be used in a JSON body for example. +- If there is no value at the requested `path`, the default value will be used. +- A third parameter (boolean) can be set to true to returns a stringified value even if it's a primitive. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------- | -------------------------------------- | +| 0 | string | Path to the query param property | +| 1 | string | Default value if property is not found | +| 2 | boolean | Stringify primitive values | + +**Examples** + +```handlebars +{{queryParam}} + + +{{queryParam 'path.to.property'}} +{{queryParam 'deep.property\.with\.dot'}} + + +{{queryParam '$.array.[*].property'}} + +{{queryParam 'path' 'default value'}} +{{queryParam 'path' 'default value' true}} +``` + +## queryParamRaw + +Get the **raw** value at a given `path` from the request's query string. Complex query strings with arrays and objects are supported. This "raw" helper is designed to work with other helpers (`each`, `if`, etc.). To directly use the retrieved data in the response, use the [`queryParam` helper](#queryparam) above. + +- The `path` supports two syntaxes, [object-path](https://www.npmjs.com/package/object-path) or [JSONPath Plus](https://www.npmjs.com/package/jsonpath-plus). When using object-path, properties containing dots are supported by escaping the dots: `key.key\.with\.dot`. +- Full objects or arrays can be retrieved by the helper. +- The full query string object can also be fetched when the `path` is omitted (`{{queryParamRaw}}`). +- If there is no value at the requested `path`, the default value will be used. +- This helper allows the use of `queryParam` within handlebars' helpers such as `{{#each}}` and `{{#if}}`. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | -------------------------------------- | +| 0 | string | Path to the query param property | +| 1 | string | Default value if property is not found | + +**Examples** + +```handlebars +{{queryParamRaw}} + + +{{queryParamRaw 'path.to.property'}} +{{queryParamRaw 'deep.property\.with\.dot'}} + + +{{queryParamRaw '$.array.[*].property'}} + +{{queryParamRaw 'path' 'default value'}} + +{{#each (queryParamRaw 'path.to.array.query' 'default value')}} + value +{{/each}} + +{{#if (queryParamRaw 'path.to.boolean.query' 'default value')}} + value +{{/if}} +``` + +## urlParam + +Get a named parameter from the route `/:paramName1/:paramName2`. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | -------------------- | +| 0 | string | Route parameter name | + +**Examples** + +```handlebars +{{urlParam 'paramName1'}} +``` + +## cookie + +Get the content of a cookie or returns a default value if the cookie is not present. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | ------------------------------------ | +| 0 | string | Cookie name | +| 1 | string | Default value if cookie is not found | + +**Examples** + +```handlebars +{{cookie 'cookie_name' 'default value'}} +``` + +## header + +Get content from any request header or returns a default value if header is not present. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | ------------------------------------ | +| 0 | string | Header name | +| 1 | string | Default value if header is not found | + +**Examples** + +```handlebars +{{header 'Header-Name' 'default value'}} +``` + +## hostname + +Returns the request hostname. + +**Examples** + +```handlebars +{{hostname}} +``` + +## ip + +Returns the request IP address. + +**Examples** + +```handlebars +{{ip}} +``` + +## method + +Returns the request method (GET, PUT, POST, etc.). + +**Examples** + +```handlebars +{{method}} +``` + +## baseUrl + +Returns the base URL of the request: protocol, host, port and API prefix. + +**Examples** + +```handlebars +{{baseUrl}} +``` diff --git a/content/docs/v6.1.0/templating/mockoon-response-helpers.md b/content/docs/v6.1.0/templating/mockoon-response-helpers.md new file mode 100644 index 00000000..7f11d081 --- /dev/null +++ b/content/docs/v6.1.0/templating/mockoon-response-helpers.md @@ -0,0 +1,29 @@ +--- +title: Response helpers +meta: + title: Dynamically customize the response with with templating helpers + description: "Dynamically customize your mock environments response with Mockoon's templating response helpers. All formats are supported: JSON, CSV, HTML, etc." +order: 503 +--- + +# Templating response helpers + +--- + +Mockoon offers the following helpers which can customize the outgoing response: + +- [`status`](#status) + +## status + +Set the response status code. This helper does not return any content. + +| Arguments (ordered) | Type | Description | +| ------------------- | ------ | --------------------------- | +| 0 | number | Valid status code (100-999) | + +**Examples** + +```handlebars +{{status 404}} +``` diff --git a/content/docs/v6.1.0/templating/overview.md b/content/docs/v6.1.0/templating/overview.md new file mode 100644 index 00000000..e5ae3817 --- /dev/null +++ b/content/docs/v6.1.0/templating/overview.md @@ -0,0 +1,202 @@ +--- +title: Overview +meta: + title: Create dynamic responses with templating + description: Create dynamic JSON responses for your mock API server with Mockoon's templating system including Faker.js +order: 500 +--- + +# Templating overview + +--- + +Mockoon implements [Handlebars](https://handlebarsjs.com/), [Faker.js v8.1.0](https://fakerjs.dev/), and a set of custom helpers to create dynamic responses. This templating system is supported in the [**data buckets**](#content-of-a-data-bucket), [**response's body**](#body-and-file-content-templating), [**header values**](#headers-and-rule-values), [**file content**](#body-and-file-content-templating), [**file path**](#file-input-templating) and [**rule values**](#headers-and-rule-values). You will find below a global overview of how and where you can use helpers. You can also check the [available helpers](#available-helpers) on specific documentation pages. + +## Helpers + +### Handlebars syntax + +All the helpers must be used according to Handlebars' syntax, for example: `{{helperName param1 param2}}`. Some helpers accepting options objects can be used with Handlebars' object params: `{{faker 'date.month' abbr=false}}`. + +Please note that a space always follows the helper name and separates each and all params like in `oneOf *space* (array *space* 'item1' *space* 'item2')`. +Also, parenthesis serves to prioritize a helper over another but not to symbolize a function call. Helpers do not require parenthesis in order to work. + +All Handlebars helpers are available (`if`, `each`, etc.). For more information, please have a look at [Handlebars' documentation](https://handlebarsjs.com/). + +### Special characters escaping + +Handlebars will escape special characters (& < > " ' \` =) by default. If you want to avoid this behavior, you can use the triple curly braces syntax:`{{{helperName}}}`. + +### Available helpers + +Besides Handlebars built-in helpers, Mockoon offers many of them: + +- [custom helpers](docs:templating/mockoon-helpers) +- [request helpers](docs:templating/mockoon-request-helpers) +- [response helpers](docs:templating/mockoon-response-helpers) +- [Faker.js library helpers](docs:templating/fakerjs-helpers) + +## Usages + +### Body and file content templating + +Templating will work in the body editor without consideration for the Content-Type that has been defined. It will also work with files content for a limited set of MIME types (`application/json`, `text/html`, `text/css`, `text/csv`, `application/javascript`, `application/typescript`, `text/plain`, `application/xhtml+xml`, `application/xml`). + +Here is an example of what you can do with this templating system: + + +```handlebars +{ + "userId": "{{urlParam 'id'}}", + "name": "{{queryParam 'name' 'John'}}", + "lang": "{{{header 'Accept-Language' 'en'}}}", + "elementTitle": "{{body 'elements.0.title' 'default'}}", + "ip": "{{ip}}", + "method": "{{method}}", + "hostname": "{{hostname}}", + "friends": [ + {{#repeat 2}} + { + "id": {{@index}}, + "name": "{{faker 'person.firstName'}} {{faker 'person.lastName'}}" + } + {{/repeat}} + ], + "oneItem": "{{oneOf (array 'item1' 'item2' 'item3')}}", + "someItemsAsString": "{{someOf (array 'item1' 'item2' 'item3') 1 2}}", + "someItemsAsArray": {{{someOf (array 'item1' 'item2' 'item3') 1 2 true}}}, + "userName": + {{#switch (urlParam 'id')}} + {{#case '1'}}"John"{{/case}} + {{#case '2'}}"Jack"{{/case}} + {{#default}}"Peter"{{/default}} + {{/switch}} +} +``` + +![body editor content{1194x493}](docs-img:body-templating.png) + +The above template produces the following body with this request: + +```http +GET /user/123456?name=john +Accept-Language: fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7 + +{ + "element": [ + {"title": "My title"} + ] +} +``` + +Response: + +```json +{ + "userId": "5", + "name": "john", + "lang": "fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7", + "elementTitle": "My title", + "ip": "::1", + "method": "GET", + "hostname": "localhost", + "friends": [ + { + "id": 0, + "name": "Stephen Bradbury" + }, + { + "id": 1, + "name": "Warren Caffey" + } + ], + "oneItem": "item1", + "someItemsAsString": "item2", + "someItemsAsArray": ["item2", "item3"], + "userName": "John" +} +``` + +This system is flexible enough to generate a lot of different contents like CSV files: + +```handlebars +firstname,lastname,countryCode +{{#repeat 10}} + {{faker 'person.firstName'}},{{faker 'person.lastName'}},{{faker + 'location.countryCode' + }} +{{/repeat}} +``` + +Response: + +```csv +firstname,lastname,countryCode +Max,Magby,AZ +Stan,Muldoon,HM +Drew,Rebelo,CY +Cory,Neal,BG +Grace,Whitson,CY +Haydee,Backer,ET +Erik,Friedrich,MX +Stephen,Paquette,PH +Neida,Durrett,PN +Vaughn,Neal,MO +``` + +#### Base64 encoding + +By using the `base64` helper, you can encode parts or entirety of the response by enclosing the content in a block helper. +Inline helper: + +```handlebars +{{base64 'test'}} +{{base64 (body 'path.to.property')}} +``` + +Block helper: + +```csv +{{# base64}} +firstname,lastname,countryCode +{{# repeat 10 }} +{{ faker 'person.firstName' }},{{ faker 'person.lastName' }},{{ faker 'location.countryCode' }} +{{/ repeat}} +{{/ base64}} +``` + +#### Disable body and file templating + +Templating can be disabled for the body and file content in each route response separately. Thus, no helper will be interpreted by the templating engine. + +First, open the **Route response settings**: + +![click on route response fourth settings tab{1228x153}](docs-img:open-route-response-settings.png) + +Then, disable the templating by checking the box: + +![check the disable templating box{1277x181}](docs-img:disable-route-response-templating.png) + +### File input templating + +Templating is also supported in the **file input field**. It allows to dynamically serve files depending on the request parameters, like `urlParam` or any other helper. Example: + +If you have a set of files named `./file1.json` and `./file2.json`, a route param can be declared (`/myroute/:id`) and retrieved with the `urlParam` helper in the file input: + +`c:/.../file{{urlParam 'id'}}.json`. + +If you call this route with `/myroute/1`, `./file1.json` will be sent. + +![add a templating helper in the file path{1208x184}](docs-img:file-path-templating.png) + +> For more information about absolute and relative file paths, please refer to our [file serving](docs:response-configuration/file-serving#absolute-or-relative-paths) documentation. + +### Headers and rule values + +Templating helpers can also be used in the **headers values** both in route headers and environment headers: + +![add a templating helper in the header value{1228x223}](docs-img:headers-templating.png) + +Finally, templating helpers can be used in the response **rule values** to create dynamic rules: + +![screenshot showing a response rule with a template helper in the value field{1228x164}](docs-img:template-helper-response-rule-value.png) diff --git a/content/releases/3.0.0.md b/content/releases/3.0.0.md index 0aa9ee27..034e8300 100644 --- a/content/releases/3.0.0.md +++ b/content/releases/3.0.0.md @@ -14,7 +14,7 @@ First, we have some exciting news to share. Mockoon has been accepted to be part ## Our platinum sponsors [![GitHub](https://mockoon.com/images/sponsors/github.png)](https://github.blog/2023-04-12-github-accelerator-our-first-cohort-and-whats-next/) -[![Appwrite](https://mockoon.com/images/sponsors/appwrite.png)](https://appwrite.io/) +[![Localazy](https://mockoon.com/images/sponsors/localazy.png)](https://localazy.com/register?ref=a9CiDC61gOac-azO) [![Peakcrypto](https://mockoon.com/images/sponsors/peakcrypto.png)](https://www.peakcrypto.com/) Mockoon is an open-source project built by volunteer maintainers. If you like our application, please consider sponsoring us and join all the [Sponsors and Backers](https://github.com/mockoon/mockoon/blob/main/backers.md) who helped this project over time! diff --git a/content/releases/3.1.0.md b/content/releases/3.1.0.md index 7b5484bf..1ae523e6 100644 --- a/content/releases/3.1.0.md +++ b/content/releases/3.1.0.md @@ -12,6 +12,7 @@ Welcome to this new release of Mockoon. There are several bug fixes and new feat ## Our platinum sponsors [![GitHub](https://mockoon.com/images/sponsors/github.png)](https://github.blog/2023-04-12-github-accelerator-our-first-cohort-and-whats-next/) +[![Localazy](https://mockoon.com/images/sponsors/localazy.png)](https://localazy.com/register?ref=a9CiDC61gOac-azO) [![Peakcrypto](https://mockoon.com/images/sponsors/peakcrypto.png)](https://www.peakcrypto.com/) Mockoon is an open-source project built by volunteer maintainers. If you like our application, please consider sponsoring us and join all the [Sponsors and Backers](https://github.com/mockoon/mockoon/blob/main/backers.md) who helped this project over time! diff --git a/content/releases/5.1.0.md b/content/releases/5.1.0.md index 077eec4a..c5c76b96 100644 --- a/content/releases/5.1.0.md +++ b/content/releases/5.1.0.md @@ -11,10 +11,9 @@ Welcome to this new release of Mockoon. It brings exciting features like a new c ## Our sponsors -| NOSTYLE | | -| ----------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | -| [![GitHub](https://mockoon.com/images/sponsors/github.png)](https://github.blog/2023-04-12-github-accelerator-our-first-cohort-and-whats-next/) | [![Localazy](https://mockoon.com/images/sponsors/localazy.png)](https://localazy.com/register?ref=a9CiDC61gOac-azO) | -| [![Peakcrypto](https://mockoon.com/images/sponsors/peakcrypto.png)](https://www.peakcrypto.com/) | [![Fern](https://mockoon.com/images/sponsors/fern.png)](https://www.devmark.ai/fern/?utm_source=mockoon&utm_loc=releasenote&utm_type=logo) | +[![GitHub](https://mockoon.com/images/sponsors/github.png)](https://github.blog/2023-04-12-github-accelerator-our-first-cohort-and-whats-next/) +[![Localazy](https://mockoon.com/images/sponsors/localazy.png)](https://localazy.com/register?ref=a9CiDC61gOac-azO) +[![Peakcrypto](https://mockoon.com/images/sponsors/peakcrypto.png)](https://www.peakcrypto.com/) Mockoon is an open-source project built by volunteer maintainers. If you like our application, please consider sponsoring us and join all the [Sponsors and Backers](https://github.com/mockoon/mockoon/blob/main/backers.md) who helped this project over time! diff --git a/content/releases/6.0.0.md b/content/releases/6.0.0.md index fc5178c5..75ed8c5f 100644 --- a/content/releases/6.0.0.md +++ b/content/releases/6.0.0.md @@ -11,10 +11,9 @@ Welcome to this new release of Mockoon. It brings new exciting features: **callb ## Our sponsors -| NOSTYLE | | -| ----------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | -| [![GitHub](https://mockoon.com/images/sponsors/github.png)](https://github.blog/2023-04-12-github-accelerator-our-first-cohort-and-whats-next/) | [![Localazy](https://mockoon.com/images/sponsors/localazy.png)](https://localazy.com/register?ref=a9CiDC61gOac-azO) | -| [![Peakcrypto](https://mockoon.com/images/sponsors/peakcrypto.png)](https://www.peakcrypto.com/) | [![Fern](https://mockoon.com/images/sponsors/fern.png)](https://www.devmark.ai/fern/?utm_source=mockoon&utm_loc=releasenote&utm_type=logo) | +[![GitHub](https://mockoon.com/images/sponsors/github.png)](https://github.blog/2023-04-12-github-accelerator-our-first-cohort-and-whats-next/) +[![Localazy](https://mockoon.com/images/sponsors/localazy.png)](https://localazy.com/register?ref=a9CiDC61gOac-azO) +[![Peakcrypto](https://mockoon.com/images/sponsors/peakcrypto.png)](https://www.peakcrypto.com/) Mockoon is an open-source project built by volunteer maintainers. If you like our application, please consider sponsoring us and join all the [Sponsors and Backers](https://github.com/mockoon/mockoon/blob/main/backers.md) who helped this project over time! diff --git a/content/releases/6.0.1.md b/content/releases/6.0.1.md index fa33b26c..aa5056e8 100644 --- a/content/releases/6.0.1.md +++ b/content/releases/6.0.1.md @@ -21,10 +21,9 @@ Welcome to this new release of Mockoon. It brings new exciting features: **callb ## Our sponsors -| NOSTYLE | | -| ----------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | -| [![GitHub](https://mockoon.com/images/sponsors/github.png)](https://github.blog/2023-04-12-github-accelerator-our-first-cohort-and-whats-next/) | [![Localazy](https://mockoon.com/images/sponsors/localazy.png)](https://localazy.com/register?ref=a9CiDC61gOac-azO) | -| [![Peakcrypto](https://mockoon.com/images/sponsors/peakcrypto.png)](https://www.peakcrypto.com/) | [![Fern](https://mockoon.com/images/sponsors/fern.png)](https://www.devmark.ai/fern/?utm_source=mockoon&utm_loc=releasenote&utm_type=logo) | +[![GitHub](https://mockoon.com/images/sponsors/github.png)](https://github.blog/2023-04-12-github-accelerator-our-first-cohort-and-whats-next/) +[![Localazy](https://mockoon.com/images/sponsors/localazy.png)](https://localazy.com/register?ref=a9CiDC61gOac-azO) +[![Peakcrypto](https://mockoon.com/images/sponsors/peakcrypto.png)](https://www.peakcrypto.com/) Mockoon is an open-source project built by volunteer maintainers. If you like our application, please consider sponsoring us and join all the [Sponsors and Backers](https://github.com/mockoon/mockoon/blob/main/backers.md) who helped this project over time! diff --git a/content/releases/6.2.0.md b/content/releases/6.2.0.md new file mode 100644 index 00000000..0e9e73a2 --- /dev/null +++ b/content/releases/6.2.0.md @@ -0,0 +1,108 @@ +--- +meta: + title: Mockoon release v6.2.0 + description: Discover Mockoon new v6.2.0 release with global variables support in rules, Linux Arm64 binaries, and many other fixes and improvements. +date: '2024-01-30' +--- + +Welcome to this new release of Mockoon. It brings new exciting features: **support for global variables in rules**, **Linux Arm64 binaries**, and many other **fixes and improvements**. Read on to learn more about this release. + +--- + +## Our platinum sponsors + +[![GitHub](https://mockoon.com/images/sponsors/github.png)](https://github.blog/2023-04-12-github-accelerator-our-first-cohort-and-whats-next/) +[![Localazy](https://mockoon.com/images/sponsors/localazy.png)](https://localazy.com/register?ref=a9CiDC61gOac-azO) +[![Peakcrypto](https://mockoon.com/images/sponsors/peakcrypto.png)](https://www.peakcrypto.com/) + +Mockoon is an open-source project built by volunteer maintainers. If you like our application, please consider sponsoring us and join all the [Sponsors and Backers](https://github.com/mockoon/mockoon/blob/main/backers.md) who helped this project over time! + +[![sponsor button](https://mockoon.com/images/sponsor-btn-250.png?)](https://github.com/sponsors/mockoon) + +--- + +## Support for global variables in response rules + +Mockoon now **supports global variables in the response rules**. This allows you to set a global variable during one call and use it in a rule to change the returned response. + +Read more about this feature in the [documentation](https://mockoon.com/docs/latest/route-responses/dynamic-rules/#1-target). + +![global variables choice in the rule target menu](/images/releases/6.2.0/global-variables-response-rules.png) + +(Issue [#1262](https://github.com/mockoon/mockoon/issues/1262)) + +## Templating helpers changes + +- Fix the `someOf` helper not correctly stringifying empty arrays and returning `[""]` instead of `[]`. (Issue [#1289](https://github.com/mockoon/mockoon/issues/1289)) +- Some Faker.js helpers like `string.alpha` can receive a complex object (more than one level deep) as a parameter. A new syntax was introduced to make their usage easier. E.g.: + `{{faker 'string.alpha' '{ length: 5, casing: "upper", exclude: ["A"] }' }}`. (Issue [#1218](https://github.com/mockoon/mockoon/issues/1218)) +- We added a third parameter to provide a default value to the [`getGlobalVar` helper](https://mockoon.com/docs/latest/templating/mockoon-helpers/#getglobalvar). (Issue [#1263](https://github.com/mockoon/mockoon/issues/1263)) +- A new [`jsonParse` helper](https://mockoon.com/docs/latest/templating/mockoon-helpers/#jsonparse) was added to parse a stringified JSON. (Issue [#1227](https://github.com/mockoon/mockoon/issues/1227)) + +## OpenAPI import improvements + +- OpenAPI endpoint's **header values** are now correctly imported from `schemas` and `examples`. (Issue [#1244](https://github.com/mockoon/mockoon/issues/1244)) +- `example` and `examples` properties are now correctly used when building a schema present in a `allOf`, `anyOf` or `oneOf`. (Issue [#948](https://github.com/mockoon/mockoon/issues/948)) + +## Support for vendor specific JSON content types + +Mockoon now **supports vendor specific JSON content types** like `application/vnd.something+json`. Request bodies with these content types will be correctly **parsed** and **available in the templating helpers and rules**. (Issue [#1269](https://github.com/mockoon/mockoon/issues/1269)) + +## Desktop application + +### New welcome screen and tour + +We updated the **welcome screen** and **added a tour** to help new users discover Mockoon's features. You can access the new tour at any time using the "Help" menu. + +The welcome screen, before and after: + +![welcome screen before and after](/images/releases/6.2.0/welcome-screen-before-after.png) + +A preview of the tour: + +![tour preview](/images/releases/6.2.0/new-tour-preview.png) + +(Issue [#1278](https://github.com/mockoon/mockoon/pull/1278)) + +### Support for Linux ARM64 architecture + +We now provide binaries (deb and AppImage) for the **Linux ARM64 architecture**. Links to these binaries are available on the [download page](https://mockoon.com/download/). Due to the limited access we have to this architecture, we can't provide a snap package at the moment. We also thank you to report any issue you may encounter with these binaries. + +![Linux ARM64 binaries](/images/releases/6.2.0/linux-arm64.png) +(Issue [#507](https://github.com/mockoon/mockoon/issues/507)) + +### MacOS new command and update quit behavior + +We reworked the macOS `cmd + W` and `cmd + Q` commands. The application will now correctly quit when pressing `cmd + Q` or using the menu's "Quit" option. We also introduced a new `cmd + W` command and application menu entry to close the current window. It should align Mockoon's behavior with other Mac applications. + +(Issue [#1097](https://github.com/mockoon/mockoon/issues/1097)) + +### Misc + +- The **"proxied" icon is now correctly displayed** in the logs when forwarded requests result from the triggering of the [fallback mode](https://mockoon.com/docs/latest/route-responses/multiple-responses/#fallback-mode). (Issue [#1267](https://github.com/mockoon/mockoon/issues/1267)) +- The **application logo was updated** for the new "sticker" design to be more visible when the operating system dark mode is enabled. (Issue [#1266](https://github.com/mockoon/mockoon/issues/1266)) +- We fixed the "Environment needs restart" orange icon disappearing after updating a property that doesn't require a restart. (Issue [#1254](https://github.com/mockoon/mockoon/pull/1254)) +- An issue was fixed causing a folder name to show another folder's name after successive editing. (Issue [#1279](https://github.com/mockoon/mockoon/issues/1279)) + +## CLI + +- We fixed a bug where the CLI could crash when used in a project importing `chalk` ESM only version (> version 5). (Issue [#1276](https://github.com/mockoon/mockoon/issues/1276)) + +## Fixes + +- The callbacks are now correctly executed when the body type is set to "file". (Issue [#1285](https://github.com/mockoon/mockoon/issues/1285)) + +## Chores + +- Fixed a test breaking after the switch to the new year! It shouldn't happen anymore 🙂. (Issue [#1248](https://github.com/mockoon/mockoon/issues/1248)) +- Removed the search filter directive in the desktop application due to an incompatibility with the `trackBy` function and replaced with observables. (Issue [#1264](https://github.com/mockoon/mockoon/pull/1264)) +- We migrated from Firebase Remote Config to our API to allow for more flexibility in the future. (Issue [#1290](https://github.com/mockoon/mockoon/pull/1290)) + +--- + +### Thank you + +A big thank you to the following people who helped to make Mockoon better: + +- [@Corwinpro](https://github.com/Corwinpro): OpenAPI examples from `allOf`. (Issue [#948](https://github.com/mockoon/mockoon/issues/948)) +- [@ajatkj](https://github.com/ajatkj): New syntax for Faker.js helpers object parameters. (Issue [#1218](https://github.com/mockoon/mockoon/issues/1218)) diff --git a/firebase.json b/firebase.json index 209eb54e..9a1b22e8 100644 --- a/firebase.json +++ b/firebase.json @@ -28,7 +28,7 @@ }, { "source": "/releases{,/}", - "destination": "/releases/6.1.0/", + "destination": "/releases/6.2.0/", "type": 302 }, { diff --git a/public/images/docs/latest/api-endpoints/crud-routes/customize-crud-id-property-key.png b/public/images/docs/latest/api-endpoints/crud-routes/customize-crud-id-property-key.png index f69a0a9c..0af3b2e4 100644 Binary files a/public/images/docs/latest/api-endpoints/crud-routes/customize-crud-id-property-key.png and b/public/images/docs/latest/api-endpoints/crud-routes/customize-crud-id-property-key.png differ diff --git a/public/images/docs/latest/api-endpoints/crud-routes/link-data-bucket-crud-route.png b/public/images/docs/latest/api-endpoints/crud-routes/link-data-bucket-crud-route.png index a666ed42..40c79b8c 100644 Binary files a/public/images/docs/latest/api-endpoints/crud-routes/link-data-bucket-crud-route.png and b/public/images/docs/latest/api-endpoints/crud-routes/link-data-bucket-crud-route.png differ diff --git a/public/images/docs/latest/api-endpoints/crud-routes/set-crud-route-path.png b/public/images/docs/latest/api-endpoints/crud-routes/set-crud-route-path.png index ffb4eabb..8ea9828b 100644 Binary files a/public/images/docs/latest/api-endpoints/crud-routes/set-crud-route-path.png and b/public/images/docs/latest/api-endpoints/crud-routes/set-crud-route-path.png differ diff --git a/public/images/docs/latest/api-endpoints/folders/routes-nested-folder.png b/public/images/docs/latest/api-endpoints/folders/routes-nested-folder.png index e7a144eb..f5b45582 100644 Binary files a/public/images/docs/latest/api-endpoints/folders/routes-nested-folder.png and b/public/images/docs/latest/api-endpoints/folders/routes-nested-folder.png differ diff --git a/public/images/docs/latest/api-endpoints/routing/environment-prefix.png b/public/images/docs/latest/api-endpoints/routing/environment-prefix.png index 8f92be4f..76ccb723 100644 Binary files a/public/images/docs/latest/api-endpoints/routing/environment-prefix.png and b/public/images/docs/latest/api-endpoints/routing/environment-prefix.png differ diff --git a/public/images/docs/latest/api-endpoints/routing/open-environment-settings.png b/public/images/docs/latest/api-endpoints/routing/open-environment-settings.png index 3cf458be..335d02f0 100644 Binary files a/public/images/docs/latest/api-endpoints/routing/open-environment-settings.png and b/public/images/docs/latest/api-endpoints/routing/open-environment-settings.png differ diff --git a/public/images/docs/latest/api-endpoints/routing/route-params.png b/public/images/docs/latest/api-endpoints/routing/route-params.png index 00dfe0e2..f6e09800 100644 Binary files a/public/images/docs/latest/api-endpoints/routing/route-params.png and b/public/images/docs/latest/api-endpoints/routing/route-params.png differ diff --git a/public/images/docs/latest/api-endpoints/routing/route-patterns.png b/public/images/docs/latest/api-endpoints/routing/route-patterns.png index 51965b96..feb70a7b 100644 Binary files a/public/images/docs/latest/api-endpoints/routing/route-patterns.png and b/public/images/docs/latest/api-endpoints/routing/route-patterns.png differ diff --git a/public/images/docs/latest/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-button.png b/public/images/docs/latest/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-button.png index ab2c9d97..90753bed 100644 Binary files a/public/images/docs/latest/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-button.png and b/public/images/docs/latest/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-button.png differ diff --git a/public/images/docs/latest/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-template-tab.png b/public/images/docs/latest/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-template-tab.png index 4e2ba809..981858b4 100644 Binary files a/public/images/docs/latest/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-template-tab.png and b/public/images/docs/latest/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-template-tab.png differ diff --git a/public/images/docs/latest/api-endpoints/templates-and-ai-assistant/ai-assistant-template-generate-options.png b/public/images/docs/latest/api-endpoints/templates-and-ai-assistant/ai-assistant-template-generate-options.png index ef6e2c92..e6cd6ae2 100644 Binary files a/public/images/docs/latest/api-endpoints/templates-and-ai-assistant/ai-assistant-template-generate-options.png and b/public/images/docs/latest/api-endpoints/templates-and-ai-assistant/ai-assistant-template-generate-options.png differ diff --git a/public/images/docs/latest/api-endpoints/templates-and-ai-assistant/pre-generated-templates-modal.png b/public/images/docs/latest/api-endpoints/templates-and-ai-assistant/pre-generated-templates-modal.png index c9827493..ced3cc1a 100644 Binary files a/public/images/docs/latest/api-endpoints/templates-and-ai-assistant/pre-generated-templates-modal.png and b/public/images/docs/latest/api-endpoints/templates-and-ai-assistant/pre-generated-templates-modal.png differ diff --git a/public/images/docs/latest/api-endpoints/templates-and-ai-assistant/templates-create-get-route.png b/public/images/docs/latest/api-endpoints/templates-and-ai-assistant/templates-create-get-route.png index 90f11523..3497be63 100644 Binary files a/public/images/docs/latest/api-endpoints/templates-and-ai-assistant/templates-create-get-route.png and b/public/images/docs/latest/api-endpoints/templates-and-ai-assistant/templates-create-get-route.png differ diff --git a/public/images/docs/latest/api-endpoints/templates-and-ai-assistant/templates-generate-get-route.png b/public/images/docs/latest/api-endpoints/templates-and-ai-assistant/templates-generate-get-route.png index badc47bd..f364eba1 100644 Binary files a/public/images/docs/latest/api-endpoints/templates-and-ai-assistant/templates-generate-get-route.png and b/public/images/docs/latest/api-endpoints/templates-and-ai-assistant/templates-generate-get-route.png differ diff --git a/public/images/docs/latest/callbacks/overview/add-callback.png b/public/images/docs/latest/callbacks/overview/add-callback.png index 2a0a5dd2..b0cd05a3 100644 Binary files a/public/images/docs/latest/callbacks/overview/add-callback.png and b/public/images/docs/latest/callbacks/overview/add-callback.png differ diff --git a/public/images/docs/latest/callbacks/overview/open-callbacks-view.png b/public/images/docs/latest/callbacks/overview/open-callbacks-view.png index 1ed48c4e..60713d46 100644 Binary files a/public/images/docs/latest/callbacks/overview/open-callbacks-view.png and b/public/images/docs/latest/callbacks/overview/open-callbacks-view.png differ diff --git a/public/images/docs/latest/callbacks/using-callbacks/link-callback-response.png b/public/images/docs/latest/callbacks/using-callbacks/link-callback-response.png index 41374919..2aaef2eb 100644 Binary files a/public/images/docs/latest/callbacks/using-callbacks/link-callback-response.png and b/public/images/docs/latest/callbacks/using-callbacks/link-callback-response.png differ diff --git a/public/images/docs/latest/callbacks/using-callbacks/open-route-response-callbacks.png b/public/images/docs/latest/callbacks/using-callbacks/open-route-response-callbacks.png index 627fb77a..5f6c4977 100644 Binary files a/public/images/docs/latest/callbacks/using-callbacks/open-route-response-callbacks.png and b/public/images/docs/latest/callbacks/using-callbacks/open-route-response-callbacks.png differ diff --git a/public/images/docs/latest/data-buckets/overview/add-data-bucket.png b/public/images/docs/latest/data-buckets/overview/add-data-bucket.png index cc481173..a325b828 100644 Binary files a/public/images/docs/latest/data-buckets/overview/add-data-bucket.png and b/public/images/docs/latest/data-buckets/overview/add-data-bucket.png differ diff --git a/public/images/docs/latest/data-buckets/overview/open-data-view.png b/public/images/docs/latest/data-buckets/overview/open-data-view.png index 473c34bf..1c71b39b 100644 Binary files a/public/images/docs/latest/data-buckets/overview/open-data-view.png and b/public/images/docs/latest/data-buckets/overview/open-data-view.png differ diff --git a/public/images/docs/latest/data-buckets/using-data-buckets/link-data-bucket-response.png b/public/images/docs/latest/data-buckets/using-data-buckets/link-data-bucket-response.png index 4a034883..ec1f6661 100644 Binary files a/public/images/docs/latest/data-buckets/using-data-buckets/link-data-bucket-response.png and b/public/images/docs/latest/data-buckets/using-data-buckets/link-data-bucket-response.png differ diff --git a/public/images/docs/latest/logging-and-recording/auto-mocking-and-recording/logs-auto-mocking.png b/public/images/docs/latest/logging-and-recording/auto-mocking-and-recording/logs-auto-mocking.png index 1cb6f292..4c0bd65d 100644 Binary files a/public/images/docs/latest/logging-and-recording/auto-mocking-and-recording/logs-auto-mocking.png and b/public/images/docs/latest/logging-and-recording/auto-mocking-and-recording/logs-auto-mocking.png differ diff --git a/public/images/docs/latest/logging-and-recording/auto-mocking-and-recording/logs-recording-in-progress.png b/public/images/docs/latest/logging-and-recording/auto-mocking-and-recording/logs-recording-in-progress.png index 01e3ae1a..0c1ee7db 100644 Binary files a/public/images/docs/latest/logging-and-recording/auto-mocking-and-recording/logs-recording-in-progress.png and b/public/images/docs/latest/logging-and-recording/auto-mocking-and-recording/logs-recording-in-progress.png differ diff --git a/public/images/docs/latest/logging-and-recording/auto-mocking-and-recording/logs-start-recording.png b/public/images/docs/latest/logging-and-recording/auto-mocking-and-recording/logs-start-recording.png index b7bf11ce..f73a4f9d 100644 Binary files a/public/images/docs/latest/logging-and-recording/auto-mocking-and-recording/logs-start-recording.png and b/public/images/docs/latest/logging-and-recording/auto-mocking-and-recording/logs-start-recording.png differ diff --git a/public/images/docs/latest/logging-and-recording/requests-logging/logs-metadata.png b/public/images/docs/latest/logging-and-recording/requests-logging/logs-metadata.png index 6e0d9b30..ed47eb79 100644 Binary files a/public/images/docs/latest/logging-and-recording/requests-logging/logs-metadata.png and b/public/images/docs/latest/logging-and-recording/requests-logging/logs-metadata.png differ diff --git a/public/images/docs/latest/logging-and-recording/requests-logging/logs-request.png b/public/images/docs/latest/logging-and-recording/requests-logging/logs-request.png index 0e89c545..eba8ba0c 100644 Binary files a/public/images/docs/latest/logging-and-recording/requests-logging/logs-request.png and b/public/images/docs/latest/logging-and-recording/requests-logging/logs-request.png differ diff --git a/public/images/docs/latest/logging-and-recording/requests-logging/logs-response.png b/public/images/docs/latest/logging-and-recording/requests-logging/logs-response.png index 8de65813..77526cc8 100644 Binary files a/public/images/docs/latest/logging-and-recording/requests-logging/logs-response.png and b/public/images/docs/latest/logging-and-recording/requests-logging/logs-response.png differ diff --git a/public/images/docs/latest/logging-and-recording/requests-logging/logs-view-body-modal.png b/public/images/docs/latest/logging-and-recording/requests-logging/logs-view-body-modal.png index d4e176cb..fce6855f 100644 Binary files a/public/images/docs/latest/logging-and-recording/requests-logging/logs-view-body-modal.png and b/public/images/docs/latest/logging-and-recording/requests-logging/logs-view-body-modal.png differ diff --git a/public/images/docs/latest/logging-and-recording/requests-logging/logs-view-body.png b/public/images/docs/latest/logging-and-recording/requests-logging/logs-view-body.png index 94624c83..9918cdcf 100644 Binary files a/public/images/docs/latest/logging-and-recording/requests-logging/logs-view-body.png and b/public/images/docs/latest/logging-and-recording/requests-logging/logs-view-body.png differ diff --git a/public/images/docs/latest/logging-and-recording/requests-logging/open-logs.png b/public/images/docs/latest/logging-and-recording/requests-logging/open-logs.png index 2a0a92ec..d7d1ad7c 100644 Binary files a/public/images/docs/latest/logging-and-recording/requests-logging/open-logs.png and b/public/images/docs/latest/logging-and-recording/requests-logging/open-logs.png differ diff --git a/public/images/docs/latest/mockoon-data-files/data-storage-location/enable-file-watching.png b/public/images/docs/latest/mockoon-data-files/data-storage-location/enable-file-watching.png index 14d484a9..21c7f28a 100644 Binary files a/public/images/docs/latest/mockoon-data-files/data-storage-location/enable-file-watching.png and b/public/images/docs/latest/mockoon-data-files/data-storage-location/enable-file-watching.png differ diff --git a/public/images/docs/latest/mockoon-data-files/data-storage-location/environment-move-to-folder.png b/public/images/docs/latest/mockoon-data-files/data-storage-location/environment-move-to-folder.png index cda847e5..af42af9e 100644 Binary files a/public/images/docs/latest/mockoon-data-files/data-storage-location/environment-move-to-folder.png and b/public/images/docs/latest/mockoon-data-files/data-storage-location/environment-move-to-folder.png differ diff --git a/public/images/docs/latest/mockoon-data-files/data-storage-location/environment-show-in-folder.png b/public/images/docs/latest/mockoon-data-files/data-storage-location/environment-show-in-folder.png index fae55493..8120f970 100644 Binary files a/public/images/docs/latest/mockoon-data-files/data-storage-location/environment-show-in-folder.png and b/public/images/docs/latest/mockoon-data-files/data-storage-location/environment-show-in-folder.png differ diff --git a/public/images/docs/latest/mockoon-data-files/environment-clipboard-copy/export-clipboard-env.png b/public/images/docs/latest/mockoon-data-files/environment-clipboard-copy/export-clipboard-env.png index 5baf56da..516b025a 100644 Binary files a/public/images/docs/latest/mockoon-data-files/environment-clipboard-copy/export-clipboard-env.png and b/public/images/docs/latest/mockoon-data-files/environment-clipboard-copy/export-clipboard-env.png differ diff --git a/public/images/docs/latest/mockoon-data-files/sharing-mock-api-files/open-environment.png b/public/images/docs/latest/mockoon-data-files/sharing-mock-api-files/open-environment.png index 0b12b1eb..24d8d3a9 100644 Binary files a/public/images/docs/latest/mockoon-data-files/sharing-mock-api-files/open-environment.png and b/public/images/docs/latest/mockoon-data-files/sharing-mock-api-files/open-environment.png differ diff --git a/public/images/docs/latest/mockoon-data-files/sharing-mock-api-files/storage-pretty-printing.png b/public/images/docs/latest/mockoon-data-files/sharing-mock-api-files/storage-pretty-printing.png index b49e557d..b41cc109 100644 Binary files a/public/images/docs/latest/mockoon-data-files/sharing-mock-api-files/storage-pretty-printing.png and b/public/images/docs/latest/mockoon-data-files/sharing-mock-api-files/storage-pretty-printing.png differ diff --git a/public/images/docs/latest/response-configuration/file-serving/enable-404-fallback.png b/public/images/docs/latest/response-configuration/file-serving/enable-404-fallback.png index b2989ae5..070508e7 100644 Binary files a/public/images/docs/latest/response-configuration/file-serving/enable-404-fallback.png and b/public/images/docs/latest/response-configuration/file-serving/enable-404-fallback.png differ diff --git a/public/images/docs/latest/response-configuration/file-serving/environment-show-in-folder.png b/public/images/docs/latest/response-configuration/file-serving/environment-show-in-folder.png index 95e89460..bbaf316f 100644 Binary files a/public/images/docs/latest/response-configuration/file-serving/environment-show-in-folder.png and b/public/images/docs/latest/response-configuration/file-serving/environment-show-in-folder.png differ diff --git a/public/images/docs/latest/response-configuration/file-serving/file-path.png b/public/images/docs/latest/response-configuration/file-serving/file-path.png index aaa692ad..8eb5a554 100644 Binary files a/public/images/docs/latest/response-configuration/file-serving/file-path.png and b/public/images/docs/latest/response-configuration/file-serving/file-path.png differ diff --git a/public/images/docs/latest/response-configuration/file-serving/route-response-disable-templating.png b/public/images/docs/latest/response-configuration/file-serving/route-response-disable-templating.png index d6e6812d..22a310df 100644 Binary files a/public/images/docs/latest/response-configuration/file-serving/route-response-disable-templating.png and b/public/images/docs/latest/response-configuration/file-serving/route-response-disable-templating.png differ diff --git a/public/images/docs/latest/response-configuration/response-body/body-data-bucket.png b/public/images/docs/latest/response-configuration/response-body/body-data-bucket.png index 3e958bd9..e31f8960 100644 Binary files a/public/images/docs/latest/response-configuration/response-body/body-data-bucket.png and b/public/images/docs/latest/response-configuration/response-body/body-data-bucket.png differ diff --git a/public/images/docs/latest/response-configuration/response-body/body-file-serving.png b/public/images/docs/latest/response-configuration/response-body/body-file-serving.png index e8a59639..9141b4b5 100644 Binary files a/public/images/docs/latest/response-configuration/response-body/body-file-serving.png and b/public/images/docs/latest/response-configuration/response-body/body-file-serving.png differ diff --git a/public/images/docs/latest/response-configuration/response-body/body-type-toggle.png b/public/images/docs/latest/response-configuration/response-body/body-type-toggle.png index 7d860384..4b8067d8 100644 Binary files a/public/images/docs/latest/response-configuration/response-body/body-type-toggle.png and b/public/images/docs/latest/response-configuration/response-body/body-type-toggle.png differ diff --git a/public/images/docs/latest/response-configuration/response-body/inline-body-editor.png b/public/images/docs/latest/response-configuration/response-body/inline-body-editor.png index 0fa460c9..45d51abb 100644 Binary files a/public/images/docs/latest/response-configuration/response-body/inline-body-editor.png and b/public/images/docs/latest/response-configuration/response-body/inline-body-editor.png differ diff --git a/public/images/docs/latest/response-configuration/response-headers/add-environment-header.png b/public/images/docs/latest/response-configuration/response-headers/add-environment-header.png index d334398e..d00bac5b 100644 Binary files a/public/images/docs/latest/response-configuration/response-headers/add-environment-header.png and b/public/images/docs/latest/response-configuration/response-headers/add-environment-header.png differ diff --git a/public/images/docs/latest/response-configuration/response-headers/add-route-header.png b/public/images/docs/latest/response-configuration/response-headers/add-route-header.png index 8417def8..9edffed6 100644 Binary files a/public/images/docs/latest/response-configuration/response-headers/add-route-header.png and b/public/images/docs/latest/response-configuration/response-headers/add-route-header.png differ diff --git a/public/images/docs/latest/response-configuration/response-headers/fill-route-header-form.png b/public/images/docs/latest/response-configuration/response-headers/fill-route-header-form.png index 6be59abb..93627e92 100644 Binary files a/public/images/docs/latest/response-configuration/response-headers/fill-route-header-form.png and b/public/images/docs/latest/response-configuration/response-headers/fill-route-header-form.png differ diff --git a/public/images/docs/latest/response-configuration/response-headers/open-environment-headers.png b/public/images/docs/latest/response-configuration/response-headers/open-environment-headers.png index 381fea71..062d93ea 100644 Binary files a/public/images/docs/latest/response-configuration/response-headers/open-environment-headers.png and b/public/images/docs/latest/response-configuration/response-headers/open-environment-headers.png differ diff --git a/public/images/docs/latest/route-responses/dynamic-rules/add-route-response-rule.png b/public/images/docs/latest/route-responses/dynamic-rules/add-route-response-rule.png index ea6c5415..0eba4f8c 100644 Binary files a/public/images/docs/latest/route-responses/dynamic-rules/add-route-response-rule.png and b/public/images/docs/latest/route-responses/dynamic-rules/add-route-response-rule.png differ diff --git a/public/images/docs/latest/route-responses/dynamic-rules/disable-rules.png b/public/images/docs/latest/route-responses/dynamic-rules/disable-rules.png index 1bd0208f..a36703c2 100644 Binary files a/public/images/docs/latest/route-responses/dynamic-rules/disable-rules.png and b/public/images/docs/latest/route-responses/dynamic-rules/disable-rules.png differ diff --git a/public/images/docs/latest/route-responses/dynamic-rules/route-response-rule-reorder.png b/public/images/docs/latest/route-responses/dynamic-rules/route-response-rule-reorder.png index 2c9b7b35..9eb1ed61 100644 Binary files a/public/images/docs/latest/route-responses/dynamic-rules/route-response-rule-reorder.png and b/public/images/docs/latest/route-responses/dynamic-rules/route-response-rule-reorder.png differ diff --git a/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-comparison-operator.png b/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-comparison-operator.png index cb861855..d17632ef 100644 Binary files a/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-comparison-operator.png and b/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-comparison-operator.png differ diff --git a/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-invert-operator.png b/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-invert-operator.png index 0c46ac7e..4bbf8687 100644 Binary files a/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-invert-operator.png and b/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-invert-operator.png differ diff --git a/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-operator.png b/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-operator.png index 9b6d479a..a0d3a2f8 100644 Binary files a/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-operator.png and b/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-operator.png differ diff --git a/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-property.png b/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-property.png index 3a81d408..d727efc4 100644 Binary files a/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-property.png and b/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-property.png differ diff --git a/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-target.png b/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-target.png index 198e6293..746b4ed9 100644 Binary files a/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-target.png and b/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-target.png differ diff --git a/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-value.png b/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-value.png index f59c679f..893393a9 100644 Binary files a/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-value.png and b/public/images/docs/latest/route-responses/dynamic-rules/route-response-rules-value.png differ diff --git a/public/images/docs/latest/route-responses/global-routes-with-rules/activate-fallback-mode.png b/public/images/docs/latest/route-responses/global-routes-with-rules/activate-fallback-mode.png index c72e0bec..cfc95aa0 100644 Binary files a/public/images/docs/latest/route-responses/global-routes-with-rules/activate-fallback-mode.png and b/public/images/docs/latest/route-responses/global-routes-with-rules/activate-fallback-mode.png differ diff --git a/public/images/docs/latest/route-responses/global-routes-with-rules/create-wildcard-route.png b/public/images/docs/latest/route-responses/global-routes-with-rules/create-wildcard-route.png index 9316453c..e96acd46 100644 Binary files a/public/images/docs/latest/route-responses/global-routes-with-rules/create-wildcard-route.png and b/public/images/docs/latest/route-responses/global-routes-with-rules/create-wildcard-route.png differ diff --git a/public/images/docs/latest/route-responses/global-routes-with-rules/response-rule-header-null.png b/public/images/docs/latest/route-responses/global-routes-with-rules/response-rule-header-null.png index d8c66cc2..89bf8c98 100644 Binary files a/public/images/docs/latest/route-responses/global-routes-with-rules/response-rule-header-null.png and b/public/images/docs/latest/route-responses/global-routes-with-rules/response-rule-header-null.png differ diff --git a/public/images/docs/latest/route-responses/global-routes-with-rules/response-status-code-401.png b/public/images/docs/latest/route-responses/global-routes-with-rules/response-status-code-401.png index 3c2b1f98..20030950 100644 Binary files a/public/images/docs/latest/route-responses/global-routes-with-rules/response-status-code-401.png and b/public/images/docs/latest/route-responses/global-routes-with-rules/response-status-code-401.png differ diff --git a/public/images/docs/latest/route-responses/multiple-responses/add-route-response.png b/public/images/docs/latest/route-responses/multiple-responses/add-route-response.png index faf4b675..d97fe9d2 100644 Binary files a/public/images/docs/latest/route-responses/multiple-responses/add-route-response.png and b/public/images/docs/latest/route-responses/multiple-responses/add-route-response.png differ diff --git a/public/images/docs/latest/route-responses/multiple-responses/change-route-responses-default.png b/public/images/docs/latest/route-responses/multiple-responses/change-route-responses-default.png index 2bf39894..ca04daa0 100644 Binary files a/public/images/docs/latest/route-responses/multiple-responses/change-route-responses-default.png and b/public/images/docs/latest/route-responses/multiple-responses/change-route-responses-default.png differ diff --git a/public/images/docs/latest/route-responses/multiple-responses/duplicate-route-response.png b/public/images/docs/latest/route-responses/multiple-responses/duplicate-route-response.png index 6dfa8f69..aa41e2fb 100644 Binary files a/public/images/docs/latest/route-responses/multiple-responses/duplicate-route-response.png and b/public/images/docs/latest/route-responses/multiple-responses/duplicate-route-response.png differ diff --git a/public/images/docs/latest/route-responses/multiple-responses/fallback-mode-responses.png b/public/images/docs/latest/route-responses/multiple-responses/fallback-mode-responses.png index 7bfccc7e..e0bd7510 100644 Binary files a/public/images/docs/latest/route-responses/multiple-responses/fallback-mode-responses.png and b/public/images/docs/latest/route-responses/multiple-responses/fallback-mode-responses.png differ diff --git a/public/images/docs/latest/route-responses/multiple-responses/random-route-responses.png b/public/images/docs/latest/route-responses/multiple-responses/random-route-responses.png index 9cd7e1cb..7b8e25a6 100644 Binary files a/public/images/docs/latest/route-responses/multiple-responses/random-route-responses.png and b/public/images/docs/latest/route-responses/multiple-responses/random-route-responses.png differ diff --git a/public/images/docs/latest/route-responses/multiple-responses/reorder-responses.png b/public/images/docs/latest/route-responses/multiple-responses/reorder-responses.png index f9302020..4dbef983 100644 Binary files a/public/images/docs/latest/route-responses/multiple-responses/reorder-responses.png and b/public/images/docs/latest/route-responses/multiple-responses/reorder-responses.png differ diff --git a/public/images/docs/latest/route-responses/multiple-responses/sequential-route-responses.png b/public/images/docs/latest/route-responses/multiple-responses/sequential-route-responses.png index b625fd9a..8570453a 100644 Binary files a/public/images/docs/latest/route-responses/multiple-responses/sequential-route-responses.png and b/public/images/docs/latest/route-responses/multiple-responses/sequential-route-responses.png differ diff --git a/public/images/docs/latest/server-configuration/cors/add-cors-headers.png b/public/images/docs/latest/server-configuration/cors/add-cors-headers.png index 1bb88c0c..47f7cbec 100644 Binary files a/public/images/docs/latest/server-configuration/cors/add-cors-headers.png and b/public/images/docs/latest/server-configuration/cors/add-cors-headers.png differ diff --git a/public/images/docs/latest/server-configuration/cors/enable-cors.png b/public/images/docs/latest/server-configuration/cors/enable-cors.png index f439eac6..aa86f27b 100644 Binary files a/public/images/docs/latest/server-configuration/cors/enable-cors.png and b/public/images/docs/latest/server-configuration/cors/enable-cors.png differ diff --git a/public/images/docs/latest/server-configuration/cors/open-environment-headers.png b/public/images/docs/latest/server-configuration/cors/open-environment-headers.png index c2571108..82d91483 100644 Binary files a/public/images/docs/latest/server-configuration/cors/open-environment-headers.png and b/public/images/docs/latest/server-configuration/cors/open-environment-headers.png differ diff --git a/public/images/docs/latest/server-configuration/cors/open-environment-settings.png b/public/images/docs/latest/server-configuration/cors/open-environment-settings.png index 2983870a..d21ec803 100644 Binary files a/public/images/docs/latest/server-configuration/cors/open-environment-settings.png and b/public/images/docs/latest/server-configuration/cors/open-environment-settings.png differ diff --git a/public/images/docs/latest/server-configuration/cors/view-cors-headers.png b/public/images/docs/latest/server-configuration/cors/view-cors-headers.png index f258e224..eb866e0c 100644 Binary files a/public/images/docs/latest/server-configuration/cors/view-cors-headers.png and b/public/images/docs/latest/server-configuration/cors/view-cors-headers.png differ diff --git a/public/images/docs/latest/server-configuration/listening-hostname/custom-hostname-setting.png b/public/images/docs/latest/server-configuration/listening-hostname/custom-hostname-setting.png index fcc16136..602189ea 100644 Binary files a/public/images/docs/latest/server-configuration/listening-hostname/custom-hostname-setting.png and b/public/images/docs/latest/server-configuration/listening-hostname/custom-hostname-setting.png differ diff --git a/public/images/docs/latest/server-configuration/listening-hostname/open-environment-settings.png b/public/images/docs/latest/server-configuration/listening-hostname/open-environment-settings.png index 58e11671..a3ea6cbd 100644 Binary files a/public/images/docs/latest/server-configuration/listening-hostname/open-environment-settings.png and b/public/images/docs/latest/server-configuration/listening-hostname/open-environment-settings.png differ diff --git a/public/images/docs/latest/server-configuration/port-prefix/environment-custom-port.png b/public/images/docs/latest/server-configuration/port-prefix/environment-custom-port.png new file mode 100644 index 00000000..62dbdb04 Binary files /dev/null and b/public/images/docs/latest/server-configuration/port-prefix/environment-custom-port.png differ diff --git a/public/images/docs/latest/server-configuration/port-prefix/environment-custom-prefix.png b/public/images/docs/latest/server-configuration/port-prefix/environment-custom-prefix.png new file mode 100644 index 00000000..76ccb723 Binary files /dev/null and b/public/images/docs/latest/server-configuration/port-prefix/environment-custom-prefix.png differ diff --git a/public/images/docs/latest/server-configuration/port-prefix/open-environment-settings.png b/public/images/docs/latest/server-configuration/port-prefix/open-environment-settings.png new file mode 100644 index 00000000..335d02f0 Binary files /dev/null and b/public/images/docs/latest/server-configuration/port-prefix/open-environment-settings.png differ diff --git a/public/images/docs/latest/server-configuration/proxy-mode/enable-proxy.png b/public/images/docs/latest/server-configuration/proxy-mode/enable-proxy.png index 5ba25dc6..b4631b4d 100644 Binary files a/public/images/docs/latest/server-configuration/proxy-mode/enable-proxy.png and b/public/images/docs/latest/server-configuration/proxy-mode/enable-proxy.png differ diff --git a/public/images/docs/latest/server-configuration/proxy-mode/open-proxy-options.png b/public/images/docs/latest/server-configuration/proxy-mode/open-proxy-options.png index d7003823..f42e8167 100644 Binary files a/public/images/docs/latest/server-configuration/proxy-mode/open-proxy-options.png and b/public/images/docs/latest/server-configuration/proxy-mode/open-proxy-options.png differ diff --git a/public/images/docs/latest/server-configuration/proxy-mode/proxy-headers.png b/public/images/docs/latest/server-configuration/proxy-mode/proxy-headers.png index f9a685da..d18d33b5 100644 Binary files a/public/images/docs/latest/server-configuration/proxy-mode/proxy-headers.png and b/public/images/docs/latest/server-configuration/proxy-mode/proxy-headers.png differ diff --git a/public/images/docs/latest/server-configuration/proxy-mode/proxy-no-forward.png b/public/images/docs/latest/server-configuration/proxy-mode/proxy-no-forward.png index f499be95..6881c9b1 100644 Binary files a/public/images/docs/latest/server-configuration/proxy-mode/proxy-no-forward.png and b/public/images/docs/latest/server-configuration/proxy-mode/proxy-no-forward.png differ diff --git a/public/images/docs/latest/server-configuration/serving-over-tls/enable-tls-custom-certificate.png b/public/images/docs/latest/server-configuration/serving-over-tls/enable-tls-custom-certificate.png index d4944557..d5bcdc99 100644 Binary files a/public/images/docs/latest/server-configuration/serving-over-tls/enable-tls-custom-certificate.png and b/public/images/docs/latest/server-configuration/serving-over-tls/enable-tls-custom-certificate.png differ diff --git a/public/images/docs/latest/server-configuration/serving-over-tls/enable-tls.png b/public/images/docs/latest/server-configuration/serving-over-tls/enable-tls.png index e28fb281..84157336 100644 Binary files a/public/images/docs/latest/server-configuration/serving-over-tls/enable-tls.png and b/public/images/docs/latest/server-configuration/serving-over-tls/enable-tls.png differ diff --git a/public/images/docs/latest/server-configuration/serving-over-tls/open-environment-settings.png b/public/images/docs/latest/server-configuration/serving-over-tls/open-environment-settings.png index c2f494da..6669df37 100644 Binary files a/public/images/docs/latest/server-configuration/serving-over-tls/open-environment-settings.png and b/public/images/docs/latest/server-configuration/serving-over-tls/open-environment-settings.png differ diff --git a/public/images/docs/latest/templating/fakerjs-helpers/settings-faker.png b/public/images/docs/latest/templating/fakerjs-helpers/settings-faker.png index b25ffc1a..0e744beb 100644 Binary files a/public/images/docs/latest/templating/fakerjs-helpers/settings-faker.png and b/public/images/docs/latest/templating/fakerjs-helpers/settings-faker.png differ diff --git a/public/images/docs/latest/templating/overview/body-templating.png b/public/images/docs/latest/templating/overview/body-templating.png index a1937e27..6ee7caa0 100644 Binary files a/public/images/docs/latest/templating/overview/body-templating.png and b/public/images/docs/latest/templating/overview/body-templating.png differ diff --git a/public/images/docs/latest/templating/overview/disable-route-response-templating.png b/public/images/docs/latest/templating/overview/disable-route-response-templating.png index 0ef4b866..a22e9c0a 100644 Binary files a/public/images/docs/latest/templating/overview/disable-route-response-templating.png and b/public/images/docs/latest/templating/overview/disable-route-response-templating.png differ diff --git a/public/images/docs/latest/templating/overview/file-path-templating.png b/public/images/docs/latest/templating/overview/file-path-templating.png index d76b6b43..854e9710 100644 Binary files a/public/images/docs/latest/templating/overview/file-path-templating.png and b/public/images/docs/latest/templating/overview/file-path-templating.png differ diff --git a/public/images/docs/latest/templating/overview/headers-templating.png b/public/images/docs/latest/templating/overview/headers-templating.png index 14a6ad22..d71425c1 100644 Binary files a/public/images/docs/latest/templating/overview/headers-templating.png and b/public/images/docs/latest/templating/overview/headers-templating.png differ diff --git a/public/images/docs/latest/templating/overview/open-route-response-settings.png b/public/images/docs/latest/templating/overview/open-route-response-settings.png index f34b2e65..43eb29f1 100644 Binary files a/public/images/docs/latest/templating/overview/open-route-response-settings.png and b/public/images/docs/latest/templating/overview/open-route-response-settings.png differ diff --git a/public/images/docs/latest/templating/overview/template-helper-response-rule-value.png b/public/images/docs/latest/templating/overview/template-helper-response-rule-value.png index 1cf87783..64b9d6cb 100644 Binary files a/public/images/docs/latest/templating/overview/template-helper-response-rule-value.png and b/public/images/docs/latest/templating/overview/template-helper-response-rule-value.png differ diff --git a/public/images/docs/v6.1.0/api-endpoints/crud-routes/add-crud-route.png b/public/images/docs/v6.1.0/api-endpoints/crud-routes/add-crud-route.png new file mode 100644 index 00000000..7b208e7d Binary files /dev/null and b/public/images/docs/v6.1.0/api-endpoints/crud-routes/add-crud-route.png differ diff --git a/public/images/docs/v6.1.0/api-endpoints/crud-routes/customize-crud-id-property-key.png b/public/images/docs/v6.1.0/api-endpoints/crud-routes/customize-crud-id-property-key.png new file mode 100644 index 00000000..f69a0a9c Binary files /dev/null and b/public/images/docs/v6.1.0/api-endpoints/crud-routes/customize-crud-id-property-key.png differ diff --git a/public/images/docs/v6.1.0/api-endpoints/crud-routes/link-data-bucket-crud-route.png b/public/images/docs/v6.1.0/api-endpoints/crud-routes/link-data-bucket-crud-route.png new file mode 100644 index 00000000..a666ed42 Binary files /dev/null and b/public/images/docs/v6.1.0/api-endpoints/crud-routes/link-data-bucket-crud-route.png differ diff --git a/public/images/docs/v6.1.0/api-endpoints/crud-routes/set-crud-route-path.png b/public/images/docs/v6.1.0/api-endpoints/crud-routes/set-crud-route-path.png new file mode 100644 index 00000000..ffb4eabb Binary files /dev/null and b/public/images/docs/v6.1.0/api-endpoints/crud-routes/set-crud-route-path.png differ diff --git a/public/images/docs/v6.1.0/api-endpoints/folders/routes-nested-folder.png b/public/images/docs/v6.1.0/api-endpoints/folders/routes-nested-folder.png new file mode 100644 index 00000000..e7a144eb Binary files /dev/null and b/public/images/docs/v6.1.0/api-endpoints/folders/routes-nested-folder.png differ diff --git a/public/images/docs/v6.1.0/api-endpoints/routing/environment-prefix.png b/public/images/docs/v6.1.0/api-endpoints/routing/environment-prefix.png new file mode 100644 index 00000000..8f92be4f Binary files /dev/null and b/public/images/docs/v6.1.0/api-endpoints/routing/environment-prefix.png differ diff --git a/public/images/docs/v6.1.0/api-endpoints/routing/open-environment-settings.png b/public/images/docs/v6.1.0/api-endpoints/routing/open-environment-settings.png new file mode 100644 index 00000000..3cf458be Binary files /dev/null and b/public/images/docs/v6.1.0/api-endpoints/routing/open-environment-settings.png differ diff --git a/public/images/docs/v6.1.0/api-endpoints/routing/route-params.png b/public/images/docs/v6.1.0/api-endpoints/routing/route-params.png new file mode 100644 index 00000000..00dfe0e2 Binary files /dev/null and b/public/images/docs/v6.1.0/api-endpoints/routing/route-params.png differ diff --git a/public/images/docs/v6.1.0/api-endpoints/routing/route-patterns.png b/public/images/docs/v6.1.0/api-endpoints/routing/route-patterns.png new file mode 100644 index 00000000..51965b96 Binary files /dev/null and b/public/images/docs/v6.1.0/api-endpoints/routing/route-patterns.png differ diff --git a/public/images/docs/v6.1.0/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-button.png b/public/images/docs/v6.1.0/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-button.png new file mode 100644 index 00000000..ab2c9d97 Binary files /dev/null and b/public/images/docs/v6.1.0/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-button.png differ diff --git a/public/images/docs/v6.1.0/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-template-tab.png b/public/images/docs/v6.1.0/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-template-tab.png new file mode 100644 index 00000000..4e2ba809 Binary files /dev/null and b/public/images/docs/v6.1.0/api-endpoints/templates-and-ai-assistant/ai-assistant-generate-template-tab.png differ diff --git a/public/images/docs/v6.1.0/api-endpoints/templates-and-ai-assistant/ai-assistant-template-generate-options.png b/public/images/docs/v6.1.0/api-endpoints/templates-and-ai-assistant/ai-assistant-template-generate-options.png new file mode 100644 index 00000000..ef6e2c92 Binary files /dev/null and b/public/images/docs/v6.1.0/api-endpoints/templates-and-ai-assistant/ai-assistant-template-generate-options.png differ diff --git a/public/images/docs/v6.1.0/api-endpoints/templates-and-ai-assistant/pre-generated-templates-modal.png b/public/images/docs/v6.1.0/api-endpoints/templates-and-ai-assistant/pre-generated-templates-modal.png new file mode 100644 index 00000000..c9827493 Binary files /dev/null and b/public/images/docs/v6.1.0/api-endpoints/templates-and-ai-assistant/pre-generated-templates-modal.png differ diff --git a/public/images/docs/v6.1.0/api-endpoints/templates-and-ai-assistant/templates-create-get-route.png b/public/images/docs/v6.1.0/api-endpoints/templates-and-ai-assistant/templates-create-get-route.png new file mode 100644 index 00000000..90f11523 Binary files /dev/null and b/public/images/docs/v6.1.0/api-endpoints/templates-and-ai-assistant/templates-create-get-route.png differ diff --git a/public/images/docs/v6.1.0/api-endpoints/templates-and-ai-assistant/templates-generate-get-route.png b/public/images/docs/v6.1.0/api-endpoints/templates-and-ai-assistant/templates-generate-get-route.png new file mode 100644 index 00000000..badc47bd Binary files /dev/null and b/public/images/docs/v6.1.0/api-endpoints/templates-and-ai-assistant/templates-generate-get-route.png differ diff --git a/public/images/docs/v6.1.0/callbacks/overview/add-callback.png b/public/images/docs/v6.1.0/callbacks/overview/add-callback.png new file mode 100644 index 00000000..2a0a5dd2 Binary files /dev/null and b/public/images/docs/v6.1.0/callbacks/overview/add-callback.png differ diff --git a/public/images/docs/v6.1.0/callbacks/overview/open-callbacks-view.png b/public/images/docs/v6.1.0/callbacks/overview/open-callbacks-view.png new file mode 100644 index 00000000..1ed48c4e Binary files /dev/null and b/public/images/docs/v6.1.0/callbacks/overview/open-callbacks-view.png differ diff --git a/public/images/docs/v6.1.0/callbacks/using-callbacks/link-callback-response.png b/public/images/docs/v6.1.0/callbacks/using-callbacks/link-callback-response.png new file mode 100644 index 00000000..41374919 Binary files /dev/null and b/public/images/docs/v6.1.0/callbacks/using-callbacks/link-callback-response.png differ diff --git a/public/images/docs/v6.1.0/callbacks/using-callbacks/open-route-response-callbacks.png b/public/images/docs/v6.1.0/callbacks/using-callbacks/open-route-response-callbacks.png new file mode 100644 index 00000000..627fb77a Binary files /dev/null and b/public/images/docs/v6.1.0/callbacks/using-callbacks/open-route-response-callbacks.png differ diff --git a/public/images/docs/v6.1.0/data-buckets/overview/add-data-bucket.png b/public/images/docs/v6.1.0/data-buckets/overview/add-data-bucket.png new file mode 100644 index 00000000..cc481173 Binary files /dev/null and b/public/images/docs/v6.1.0/data-buckets/overview/add-data-bucket.png differ diff --git a/public/images/docs/v6.1.0/data-buckets/overview/open-data-view.png b/public/images/docs/v6.1.0/data-buckets/overview/open-data-view.png new file mode 100644 index 00000000..473c34bf Binary files /dev/null and b/public/images/docs/v6.1.0/data-buckets/overview/open-data-view.png differ diff --git a/public/images/docs/v6.1.0/data-buckets/using-data-buckets/link-data-bucket-response.png b/public/images/docs/v6.1.0/data-buckets/using-data-buckets/link-data-bucket-response.png new file mode 100644 index 00000000..4a034883 Binary files /dev/null and b/public/images/docs/v6.1.0/data-buckets/using-data-buckets/link-data-bucket-response.png differ diff --git a/public/images/docs/v6.1.0/logging-and-recording/auto-mocking-and-recording/logs-auto-mocking.png b/public/images/docs/v6.1.0/logging-and-recording/auto-mocking-and-recording/logs-auto-mocking.png new file mode 100644 index 00000000..1cb6f292 Binary files /dev/null and b/public/images/docs/v6.1.0/logging-and-recording/auto-mocking-and-recording/logs-auto-mocking.png differ diff --git a/public/images/docs/v6.1.0/logging-and-recording/auto-mocking-and-recording/logs-recording-in-progress.png b/public/images/docs/v6.1.0/logging-and-recording/auto-mocking-and-recording/logs-recording-in-progress.png new file mode 100644 index 00000000..01e3ae1a Binary files /dev/null and b/public/images/docs/v6.1.0/logging-and-recording/auto-mocking-and-recording/logs-recording-in-progress.png differ diff --git a/public/images/docs/v6.1.0/logging-and-recording/auto-mocking-and-recording/logs-start-recording.png b/public/images/docs/v6.1.0/logging-and-recording/auto-mocking-and-recording/logs-start-recording.png new file mode 100644 index 00000000..b7bf11ce Binary files /dev/null and b/public/images/docs/v6.1.0/logging-and-recording/auto-mocking-and-recording/logs-start-recording.png differ diff --git a/public/images/docs/v6.1.0/logging-and-recording/requests-logging/logs-metadata.png b/public/images/docs/v6.1.0/logging-and-recording/requests-logging/logs-metadata.png new file mode 100644 index 00000000..6e0d9b30 Binary files /dev/null and b/public/images/docs/v6.1.0/logging-and-recording/requests-logging/logs-metadata.png differ diff --git a/public/images/docs/v6.1.0/logging-and-recording/requests-logging/logs-request.png b/public/images/docs/v6.1.0/logging-and-recording/requests-logging/logs-request.png new file mode 100644 index 00000000..0e89c545 Binary files /dev/null and b/public/images/docs/v6.1.0/logging-and-recording/requests-logging/logs-request.png differ diff --git a/public/images/docs/v6.1.0/logging-and-recording/requests-logging/logs-response.png b/public/images/docs/v6.1.0/logging-and-recording/requests-logging/logs-response.png new file mode 100644 index 00000000..8de65813 Binary files /dev/null and b/public/images/docs/v6.1.0/logging-and-recording/requests-logging/logs-response.png differ diff --git a/public/images/docs/v6.1.0/logging-and-recording/requests-logging/logs-view-body-modal.png b/public/images/docs/v6.1.0/logging-and-recording/requests-logging/logs-view-body-modal.png new file mode 100644 index 00000000..d4e176cb Binary files /dev/null and b/public/images/docs/v6.1.0/logging-and-recording/requests-logging/logs-view-body-modal.png differ diff --git a/public/images/docs/v6.1.0/logging-and-recording/requests-logging/logs-view-body.png b/public/images/docs/v6.1.0/logging-and-recording/requests-logging/logs-view-body.png new file mode 100644 index 00000000..94624c83 Binary files /dev/null and b/public/images/docs/v6.1.0/logging-and-recording/requests-logging/logs-view-body.png differ diff --git a/public/images/docs/v6.1.0/logging-and-recording/requests-logging/open-logs.png b/public/images/docs/v6.1.0/logging-and-recording/requests-logging/open-logs.png new file mode 100644 index 00000000..2a0a92ec Binary files /dev/null and b/public/images/docs/v6.1.0/logging-and-recording/requests-logging/open-logs.png differ diff --git a/public/images/docs/v6.1.0/mockoon-data-files/data-storage-location/enable-file-watching.png b/public/images/docs/v6.1.0/mockoon-data-files/data-storage-location/enable-file-watching.png new file mode 100644 index 00000000..14d484a9 Binary files /dev/null and b/public/images/docs/v6.1.0/mockoon-data-files/data-storage-location/enable-file-watching.png differ diff --git a/public/images/docs/v6.1.0/mockoon-data-files/data-storage-location/environment-move-to-folder.png b/public/images/docs/v6.1.0/mockoon-data-files/data-storage-location/environment-move-to-folder.png new file mode 100644 index 00000000..cda847e5 Binary files /dev/null and b/public/images/docs/v6.1.0/mockoon-data-files/data-storage-location/environment-move-to-folder.png differ diff --git a/public/images/docs/v6.1.0/mockoon-data-files/data-storage-location/environment-show-in-folder.png b/public/images/docs/v6.1.0/mockoon-data-files/data-storage-location/environment-show-in-folder.png new file mode 100644 index 00000000..fae55493 Binary files /dev/null and b/public/images/docs/v6.1.0/mockoon-data-files/data-storage-location/environment-show-in-folder.png differ diff --git a/public/images/docs/v6.1.0/mockoon-data-files/environment-clipboard-copy/export-clipboard-env.png b/public/images/docs/v6.1.0/mockoon-data-files/environment-clipboard-copy/export-clipboard-env.png new file mode 100644 index 00000000..5baf56da Binary files /dev/null and b/public/images/docs/v6.1.0/mockoon-data-files/environment-clipboard-copy/export-clipboard-env.png differ diff --git a/public/images/docs/v6.1.0/mockoon-data-files/sharing-mock-api-files/open-environment.png b/public/images/docs/v6.1.0/mockoon-data-files/sharing-mock-api-files/open-environment.png new file mode 100644 index 00000000..0b12b1eb Binary files /dev/null and b/public/images/docs/v6.1.0/mockoon-data-files/sharing-mock-api-files/open-environment.png differ diff --git a/public/images/docs/v6.1.0/mockoon-data-files/sharing-mock-api-files/storage-pretty-printing.png b/public/images/docs/v6.1.0/mockoon-data-files/sharing-mock-api-files/storage-pretty-printing.png new file mode 100644 index 00000000..b49e557d Binary files /dev/null and b/public/images/docs/v6.1.0/mockoon-data-files/sharing-mock-api-files/storage-pretty-printing.png differ diff --git a/public/images/docs/v6.1.0/response-configuration/file-serving/enable-404-fallback.png b/public/images/docs/v6.1.0/response-configuration/file-serving/enable-404-fallback.png new file mode 100644 index 00000000..b2989ae5 Binary files /dev/null and b/public/images/docs/v6.1.0/response-configuration/file-serving/enable-404-fallback.png differ diff --git a/public/images/docs/v6.1.0/response-configuration/file-serving/environment-show-in-folder.png b/public/images/docs/v6.1.0/response-configuration/file-serving/environment-show-in-folder.png new file mode 100644 index 00000000..95e89460 Binary files /dev/null and b/public/images/docs/v6.1.0/response-configuration/file-serving/environment-show-in-folder.png differ diff --git a/public/images/docs/v6.1.0/response-configuration/file-serving/file-path.png b/public/images/docs/v6.1.0/response-configuration/file-serving/file-path.png new file mode 100644 index 00000000..aaa692ad Binary files /dev/null and b/public/images/docs/v6.1.0/response-configuration/file-serving/file-path.png differ diff --git a/public/images/docs/v6.1.0/response-configuration/file-serving/route-response-disable-templating.png b/public/images/docs/v6.1.0/response-configuration/file-serving/route-response-disable-templating.png new file mode 100644 index 00000000..d6e6812d Binary files /dev/null and b/public/images/docs/v6.1.0/response-configuration/file-serving/route-response-disable-templating.png differ diff --git a/public/images/docs/v6.1.0/response-configuration/response-body/body-data-bucket.png b/public/images/docs/v6.1.0/response-configuration/response-body/body-data-bucket.png new file mode 100644 index 00000000..3e958bd9 Binary files /dev/null and b/public/images/docs/v6.1.0/response-configuration/response-body/body-data-bucket.png differ diff --git a/public/images/docs/v6.1.0/response-configuration/response-body/body-file-serving.png b/public/images/docs/v6.1.0/response-configuration/response-body/body-file-serving.png new file mode 100644 index 00000000..e8a59639 Binary files /dev/null and b/public/images/docs/v6.1.0/response-configuration/response-body/body-file-serving.png differ diff --git a/public/images/docs/v6.1.0/response-configuration/response-body/body-type-toggle.png b/public/images/docs/v6.1.0/response-configuration/response-body/body-type-toggle.png new file mode 100644 index 00000000..7d860384 Binary files /dev/null and b/public/images/docs/v6.1.0/response-configuration/response-body/body-type-toggle.png differ diff --git a/public/images/docs/v6.1.0/response-configuration/response-body/inline-body-editor.png b/public/images/docs/v6.1.0/response-configuration/response-body/inline-body-editor.png new file mode 100644 index 00000000..0fa460c9 Binary files /dev/null and b/public/images/docs/v6.1.0/response-configuration/response-body/inline-body-editor.png differ diff --git a/public/images/docs/v6.1.0/response-configuration/response-headers/add-environment-header.png b/public/images/docs/v6.1.0/response-configuration/response-headers/add-environment-header.png new file mode 100644 index 00000000..d334398e Binary files /dev/null and b/public/images/docs/v6.1.0/response-configuration/response-headers/add-environment-header.png differ diff --git a/public/images/docs/v6.1.0/response-configuration/response-headers/add-route-header.png b/public/images/docs/v6.1.0/response-configuration/response-headers/add-route-header.png new file mode 100644 index 00000000..8417def8 Binary files /dev/null and b/public/images/docs/v6.1.0/response-configuration/response-headers/add-route-header.png differ diff --git a/public/images/docs/v6.1.0/response-configuration/response-headers/fill-route-header-form.png b/public/images/docs/v6.1.0/response-configuration/response-headers/fill-route-header-form.png new file mode 100644 index 00000000..6be59abb Binary files /dev/null and b/public/images/docs/v6.1.0/response-configuration/response-headers/fill-route-header-form.png differ diff --git a/public/images/docs/v6.1.0/response-configuration/response-headers/open-environment-headers.png b/public/images/docs/v6.1.0/response-configuration/response-headers/open-environment-headers.png new file mode 100644 index 00000000..381fea71 Binary files /dev/null and b/public/images/docs/v6.1.0/response-configuration/response-headers/open-environment-headers.png differ diff --git a/public/images/docs/v6.1.0/route-responses/dynamic-rules/add-route-response-rule.png b/public/images/docs/v6.1.0/route-responses/dynamic-rules/add-route-response-rule.png new file mode 100644 index 00000000..ea6c5415 Binary files /dev/null and b/public/images/docs/v6.1.0/route-responses/dynamic-rules/add-route-response-rule.png differ diff --git a/public/images/docs/v6.1.0/route-responses/dynamic-rules/disable-rules.png b/public/images/docs/v6.1.0/route-responses/dynamic-rules/disable-rules.png new file mode 100644 index 00000000..1bd0208f Binary files /dev/null and b/public/images/docs/v6.1.0/route-responses/dynamic-rules/disable-rules.png differ diff --git a/public/images/docs/v6.1.0/route-responses/dynamic-rules/route-response-rule-reorder.png b/public/images/docs/v6.1.0/route-responses/dynamic-rules/route-response-rule-reorder.png new file mode 100644 index 00000000..2c9b7b35 Binary files /dev/null and b/public/images/docs/v6.1.0/route-responses/dynamic-rules/route-response-rule-reorder.png differ diff --git a/public/images/docs/v6.1.0/route-responses/dynamic-rules/route-response-rules-comparison-operator.png b/public/images/docs/v6.1.0/route-responses/dynamic-rules/route-response-rules-comparison-operator.png new file mode 100644 index 00000000..cb861855 Binary files /dev/null and b/public/images/docs/v6.1.0/route-responses/dynamic-rules/route-response-rules-comparison-operator.png differ diff --git a/public/images/docs/v6.1.0/route-responses/dynamic-rules/route-response-rules-invert-operator.png b/public/images/docs/v6.1.0/route-responses/dynamic-rules/route-response-rules-invert-operator.png new file mode 100644 index 00000000..0c46ac7e Binary files /dev/null and b/public/images/docs/v6.1.0/route-responses/dynamic-rules/route-response-rules-invert-operator.png differ diff --git a/public/images/docs/v6.1.0/route-responses/dynamic-rules/route-response-rules-operator.png b/public/images/docs/v6.1.0/route-responses/dynamic-rules/route-response-rules-operator.png new file mode 100644 index 00000000..9b6d479a Binary files /dev/null and b/public/images/docs/v6.1.0/route-responses/dynamic-rules/route-response-rules-operator.png differ diff --git a/public/images/docs/v6.1.0/route-responses/dynamic-rules/route-response-rules-property.png b/public/images/docs/v6.1.0/route-responses/dynamic-rules/route-response-rules-property.png new file mode 100644 index 00000000..3a81d408 Binary files /dev/null and b/public/images/docs/v6.1.0/route-responses/dynamic-rules/route-response-rules-property.png differ diff --git a/public/images/docs/v6.1.0/route-responses/dynamic-rules/route-response-rules-target.png b/public/images/docs/v6.1.0/route-responses/dynamic-rules/route-response-rules-target.png new file mode 100644 index 00000000..198e6293 Binary files /dev/null and b/public/images/docs/v6.1.0/route-responses/dynamic-rules/route-response-rules-target.png differ diff --git a/public/images/docs/v6.1.0/route-responses/dynamic-rules/route-response-rules-value.png b/public/images/docs/v6.1.0/route-responses/dynamic-rules/route-response-rules-value.png new file mode 100644 index 00000000..f59c679f Binary files /dev/null and b/public/images/docs/v6.1.0/route-responses/dynamic-rules/route-response-rules-value.png differ diff --git a/public/images/docs/v6.1.0/route-responses/global-routes-with-rules/activate-fallback-mode.png b/public/images/docs/v6.1.0/route-responses/global-routes-with-rules/activate-fallback-mode.png new file mode 100644 index 00000000..c72e0bec Binary files /dev/null and b/public/images/docs/v6.1.0/route-responses/global-routes-with-rules/activate-fallback-mode.png differ diff --git a/public/images/docs/v6.1.0/route-responses/global-routes-with-rules/create-wildcard-route.png b/public/images/docs/v6.1.0/route-responses/global-routes-with-rules/create-wildcard-route.png new file mode 100644 index 00000000..9316453c Binary files /dev/null and b/public/images/docs/v6.1.0/route-responses/global-routes-with-rules/create-wildcard-route.png differ diff --git a/public/images/docs/v6.1.0/route-responses/global-routes-with-rules/response-rule-header-null.png b/public/images/docs/v6.1.0/route-responses/global-routes-with-rules/response-rule-header-null.png new file mode 100644 index 00000000..d8c66cc2 Binary files /dev/null and b/public/images/docs/v6.1.0/route-responses/global-routes-with-rules/response-rule-header-null.png differ diff --git a/public/images/docs/v6.1.0/route-responses/global-routes-with-rules/response-status-code-401.png b/public/images/docs/v6.1.0/route-responses/global-routes-with-rules/response-status-code-401.png new file mode 100644 index 00000000..3c2b1f98 Binary files /dev/null and b/public/images/docs/v6.1.0/route-responses/global-routes-with-rules/response-status-code-401.png differ diff --git a/public/images/docs/v6.1.0/route-responses/multiple-responses/add-route-response.png b/public/images/docs/v6.1.0/route-responses/multiple-responses/add-route-response.png new file mode 100644 index 00000000..faf4b675 Binary files /dev/null and b/public/images/docs/v6.1.0/route-responses/multiple-responses/add-route-response.png differ diff --git a/public/images/docs/v6.1.0/route-responses/multiple-responses/change-route-responses-default.png b/public/images/docs/v6.1.0/route-responses/multiple-responses/change-route-responses-default.png new file mode 100644 index 00000000..2bf39894 Binary files /dev/null and b/public/images/docs/v6.1.0/route-responses/multiple-responses/change-route-responses-default.png differ diff --git a/public/images/docs/v6.1.0/route-responses/multiple-responses/duplicate-route-response.png b/public/images/docs/v6.1.0/route-responses/multiple-responses/duplicate-route-response.png new file mode 100644 index 00000000..6dfa8f69 Binary files /dev/null and b/public/images/docs/v6.1.0/route-responses/multiple-responses/duplicate-route-response.png differ diff --git a/public/images/docs/v6.1.0/route-responses/multiple-responses/fallback-mode-responses.png b/public/images/docs/v6.1.0/route-responses/multiple-responses/fallback-mode-responses.png new file mode 100644 index 00000000..7bfccc7e Binary files /dev/null and b/public/images/docs/v6.1.0/route-responses/multiple-responses/fallback-mode-responses.png differ diff --git a/public/images/docs/v6.1.0/route-responses/multiple-responses/random-route-responses.png b/public/images/docs/v6.1.0/route-responses/multiple-responses/random-route-responses.png new file mode 100644 index 00000000..9cd7e1cb Binary files /dev/null and b/public/images/docs/v6.1.0/route-responses/multiple-responses/random-route-responses.png differ diff --git a/public/images/docs/v6.1.0/route-responses/multiple-responses/reorder-responses.png b/public/images/docs/v6.1.0/route-responses/multiple-responses/reorder-responses.png new file mode 100644 index 00000000..f9302020 Binary files /dev/null and b/public/images/docs/v6.1.0/route-responses/multiple-responses/reorder-responses.png differ diff --git a/public/images/docs/v6.1.0/route-responses/multiple-responses/sequential-route-responses.png b/public/images/docs/v6.1.0/route-responses/multiple-responses/sequential-route-responses.png new file mode 100644 index 00000000..b625fd9a Binary files /dev/null and b/public/images/docs/v6.1.0/route-responses/multiple-responses/sequential-route-responses.png differ diff --git a/public/images/docs/v6.1.0/server-configuration/cors/add-cors-headers.png b/public/images/docs/v6.1.0/server-configuration/cors/add-cors-headers.png new file mode 100644 index 00000000..1bb88c0c Binary files /dev/null and b/public/images/docs/v6.1.0/server-configuration/cors/add-cors-headers.png differ diff --git a/public/images/docs/v6.1.0/server-configuration/cors/enable-cors.png b/public/images/docs/v6.1.0/server-configuration/cors/enable-cors.png new file mode 100644 index 00000000..f439eac6 Binary files /dev/null and b/public/images/docs/v6.1.0/server-configuration/cors/enable-cors.png differ diff --git a/public/images/docs/v6.1.0/server-configuration/cors/open-environment-headers.png b/public/images/docs/v6.1.0/server-configuration/cors/open-environment-headers.png new file mode 100644 index 00000000..c2571108 Binary files /dev/null and b/public/images/docs/v6.1.0/server-configuration/cors/open-environment-headers.png differ diff --git a/public/images/docs/v6.1.0/server-configuration/cors/open-environment-settings.png b/public/images/docs/v6.1.0/server-configuration/cors/open-environment-settings.png new file mode 100644 index 00000000..2983870a Binary files /dev/null and b/public/images/docs/v6.1.0/server-configuration/cors/open-environment-settings.png differ diff --git a/public/images/docs/v6.1.0/server-configuration/cors/view-cors-headers.png b/public/images/docs/v6.1.0/server-configuration/cors/view-cors-headers.png new file mode 100644 index 00000000..f258e224 Binary files /dev/null and b/public/images/docs/v6.1.0/server-configuration/cors/view-cors-headers.png differ diff --git a/public/images/docs/v6.1.0/server-configuration/listening-hostname/custom-hostname-setting.png b/public/images/docs/v6.1.0/server-configuration/listening-hostname/custom-hostname-setting.png new file mode 100644 index 00000000..fcc16136 Binary files /dev/null and b/public/images/docs/v6.1.0/server-configuration/listening-hostname/custom-hostname-setting.png differ diff --git a/public/images/docs/v6.1.0/server-configuration/listening-hostname/open-environment-settings.png b/public/images/docs/v6.1.0/server-configuration/listening-hostname/open-environment-settings.png new file mode 100644 index 00000000..58e11671 Binary files /dev/null and b/public/images/docs/v6.1.0/server-configuration/listening-hostname/open-environment-settings.png differ diff --git a/public/images/docs/v6.1.0/server-configuration/proxy-mode/enable-proxy.png b/public/images/docs/v6.1.0/server-configuration/proxy-mode/enable-proxy.png new file mode 100644 index 00000000..5ba25dc6 Binary files /dev/null and b/public/images/docs/v6.1.0/server-configuration/proxy-mode/enable-proxy.png differ diff --git a/public/images/docs/v6.1.0/server-configuration/proxy-mode/open-proxy-options.png b/public/images/docs/v6.1.0/server-configuration/proxy-mode/open-proxy-options.png new file mode 100644 index 00000000..d7003823 Binary files /dev/null and b/public/images/docs/v6.1.0/server-configuration/proxy-mode/open-proxy-options.png differ diff --git a/public/images/docs/v6.1.0/server-configuration/proxy-mode/proxy-headers.png b/public/images/docs/v6.1.0/server-configuration/proxy-mode/proxy-headers.png new file mode 100644 index 00000000..f9a685da Binary files /dev/null and b/public/images/docs/v6.1.0/server-configuration/proxy-mode/proxy-headers.png differ diff --git a/public/images/docs/v6.1.0/server-configuration/proxy-mode/proxy-no-forward.png b/public/images/docs/v6.1.0/server-configuration/proxy-mode/proxy-no-forward.png new file mode 100644 index 00000000..f499be95 Binary files /dev/null and b/public/images/docs/v6.1.0/server-configuration/proxy-mode/proxy-no-forward.png differ diff --git a/public/images/docs/v6.1.0/server-configuration/serving-over-tls/enable-tls-custom-certificate.png b/public/images/docs/v6.1.0/server-configuration/serving-over-tls/enable-tls-custom-certificate.png new file mode 100644 index 00000000..d4944557 Binary files /dev/null and b/public/images/docs/v6.1.0/server-configuration/serving-over-tls/enable-tls-custom-certificate.png differ diff --git a/public/images/docs/v6.1.0/server-configuration/serving-over-tls/enable-tls.png b/public/images/docs/v6.1.0/server-configuration/serving-over-tls/enable-tls.png new file mode 100644 index 00000000..e28fb281 Binary files /dev/null and b/public/images/docs/v6.1.0/server-configuration/serving-over-tls/enable-tls.png differ diff --git a/public/images/docs/v6.1.0/server-configuration/serving-over-tls/open-environment-settings.png b/public/images/docs/v6.1.0/server-configuration/serving-over-tls/open-environment-settings.png new file mode 100644 index 00000000..c2f494da Binary files /dev/null and b/public/images/docs/v6.1.0/server-configuration/serving-over-tls/open-environment-settings.png differ diff --git a/public/images/docs/v6.1.0/templating/fakerjs-helpers/settings-faker.png b/public/images/docs/v6.1.0/templating/fakerjs-helpers/settings-faker.png new file mode 100644 index 00000000..b25ffc1a Binary files /dev/null and b/public/images/docs/v6.1.0/templating/fakerjs-helpers/settings-faker.png differ diff --git a/public/images/docs/v6.1.0/templating/overview/body-templating.png b/public/images/docs/v6.1.0/templating/overview/body-templating.png new file mode 100644 index 00000000..a1937e27 Binary files /dev/null and b/public/images/docs/v6.1.0/templating/overview/body-templating.png differ diff --git a/public/images/docs/v6.1.0/templating/overview/disable-route-response-templating.png b/public/images/docs/v6.1.0/templating/overview/disable-route-response-templating.png new file mode 100644 index 00000000..0ef4b866 Binary files /dev/null and b/public/images/docs/v6.1.0/templating/overview/disable-route-response-templating.png differ diff --git a/public/images/docs/v6.1.0/templating/overview/file-path-templating.png b/public/images/docs/v6.1.0/templating/overview/file-path-templating.png new file mode 100644 index 00000000..d76b6b43 Binary files /dev/null and b/public/images/docs/v6.1.0/templating/overview/file-path-templating.png differ diff --git a/public/images/docs/v6.1.0/templating/overview/headers-templating.png b/public/images/docs/v6.1.0/templating/overview/headers-templating.png new file mode 100644 index 00000000..14a6ad22 Binary files /dev/null and b/public/images/docs/v6.1.0/templating/overview/headers-templating.png differ diff --git a/public/images/docs/v6.1.0/templating/overview/open-route-response-settings.png b/public/images/docs/v6.1.0/templating/overview/open-route-response-settings.png new file mode 100644 index 00000000..f34b2e65 Binary files /dev/null and b/public/images/docs/v6.1.0/templating/overview/open-route-response-settings.png differ diff --git a/public/images/docs/v6.1.0/templating/overview/template-helper-response-rule-value.png b/public/images/docs/v6.1.0/templating/overview/template-helper-response-rule-value.png new file mode 100644 index 00000000..1cf87783 Binary files /dev/null and b/public/images/docs/v6.1.0/templating/overview/template-helper-response-rule-value.png differ diff --git a/public/images/releases/6.2.0/global-variables-response-rules.png b/public/images/releases/6.2.0/global-variables-response-rules.png new file mode 100644 index 00000000..d995940c Binary files /dev/null and b/public/images/releases/6.2.0/global-variables-response-rules.png differ diff --git a/public/images/releases/6.2.0/linux-arm64.png b/public/images/releases/6.2.0/linux-arm64.png new file mode 100644 index 00000000..c3375e77 Binary files /dev/null and b/public/images/releases/6.2.0/linux-arm64.png differ diff --git a/public/images/releases/6.2.0/new-tour-preview.png b/public/images/releases/6.2.0/new-tour-preview.png new file mode 100644 index 00000000..03c7981a Binary files /dev/null and b/public/images/releases/6.2.0/new-tour-preview.png differ diff --git a/public/images/releases/6.2.0/welcome-screen-before-after.png b/public/images/releases/6.2.0/welcome-screen-before-after.png new file mode 100644 index 00000000..72ae4fd7 Binary files /dev/null and b/public/images/releases/6.2.0/welcome-screen-before-after.png differ