Skip to content

Instantly share code, notes, and snippets.

@mertyildiran
Created May 15, 2021 23:49
Show Gist options
  • Save mertyildiran/4a7c237bad7070ec277efc8b6af8f21b to your computer and use it in GitHub Desktop.
Save mertyildiran/4a7c237bad7070ec277efc8b6af8f21b to your computer and use it in GitHub Desktop.
Mockintosh: mocks for microservice environments - Part 1: Configuration Syntax
services:
- port: 8081
endpoints:
- path: "/example"
response: "hello world"
services:
- port: 8081
endpoints:
- path: "/example"
response:
headers:
Content-Type: "application/json"
body: '{"message": "hello world"}'
services:
- port: 8081
endpoints:
- path: "/example"
response:
status: 403
headers:
Content-Type: "application/json"
body: '{"message": "hello world"}'
services:
- port: 8081
endpoints:
- path: "/reset"
response:
status: "RST"
- path: "/close"
response:
status: "FIN"
services:
- port: 8081
endpoints:
- path: "/example"
status: 403
response:
headers:
Content-Type: "application/json"
body: '{"message": "hello world"}'
services: []
services:
- port: 8081
endpoints:
- path: "/example/{{ id }}"
response: "id is {{ id }} and a random integer: {{ random.int 1 100 }}"
templatingEngine: Jinja2
services:
- port: 8081
endpoints:
- path: "/example/{{ id }}"
response: "id is {{ id }} and a random integer: {{ random.int(1, 100) }}"
templatingEngine: Jinja2
services:
- port: 8081
endpoints:
- path: "/example/{{ id }}"
response: "id is {{ id }} and a random integer: {{ random.int 1 100 }}"
globals:
headers:
Content-Type: "application/json"
services:
- port: 8081
endpoints:
- path: "/example"
response:
status: 200
body: '{"message": "hello world"}'
- port: 8082
endpoints:
- path: "/example2"
response:
status: 202
body: '{"message": "hello universe"}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment