Closed mbana closed 1 year ago
curl -v -H 'Accept: application/json' 192.168.49.2/todos should work.
curl -v -H 'Accept: application/json' 192.168.49.2/todos
examples/mocking/gateway/**
Example of Gateway mocking taken from [2] and added a deployment manifest.
skaffold.yaml
skaffold.sh
Makefile
.vscode/launch.json
Tidy up skaffold.yaml, skaffold.sh and Makefile.
Add .vscode/launch.json that contains debugger configuration for attaching to the manager from within VS Code.
1: https://github.com/kubeshop/kusk-gateway/issues/298. 2: https://pastebin.com/raw/avYFtZpX.
$ curl -v -H 'Accept: application/json' 192.168.49.2/todos * Trying 192.168.49.2:80... * Connected to 192.168.49.2 (192.168.49.2) port 80 (#0) > GET /todos HTTP/1.1 > Host: 192.168.49.2 > User-Agent: curl/7.85.0 > Accept: application/json > * Mark bundle as not supporting multiuse < HTTP/1.1 200 OK < access-control-allow-origin: * < access-control-max-age: 86200 < access-control-allow-credentials: true < x-kusk-mocked: true < content-type: application/json < content-length: 86 < date: Tue, 06 Dec 2022 14:06:53 GMT < server: envoy < * Connection #0 to host 192.168.49.2 left intact {"completed":true,"order":13,"title":"Mocked JSON title","url":"http://mockedURL.com"}% $ curl -v -H 'Accept: application/xml' 192.168.49.2/todos * Trying 192.168.49.2:80... * Connected to 192.168.49.2 (192.168.49.2) port 80 (#0) > GET /todos HTTP/1.1 > Host: 192.168.49.2 > User-Agent: curl/7.85.0 > Accept: application/xml > * Mark bundle as not supporting multiuse < HTTP/1.1 200 OK < access-control-allow-origin: * < access-control-max-age: 86200 < access-control-allow-credentials: true < x-kusk-mocked: true < content-type: application/xml < content-length: 117 < date: Tue, 06 Dec 2022 14:06:58 GMT < server: envoy < * Connection #0 to host 192.168.49.2 left intact <doc><completed>true</completed><order>13</order><title>Mocked XML title</title><url>http://mockedURL.com</url></doc>% $ curl -v -H 'Accept: text/plain' 192.168.49.2/todos * Trying 192.168.49.2:80... * Connected to 192.168.49.2 (192.168.49.2) port 80 (#0) > GET /todos HTTP/1.1 > Host: 192.168.49.2 > User-Agent: curl/7.85.0 > Accept: text/plain > * Mark bundle as not supporting multiuse < HTTP/1.1 200 OK < access-control-allow-origin: * < access-control-max-age: 86200 < access-control-allow-credentials: true < x-kusk-mocked: true < content-type: text/plain < content-length: 81 < date: Tue, 06 Dec 2022 14:07:04 GMT < server: envoy < title: "Mocked Text title" completed: true order: 13 url: "http://mockedURL.com" * Connection #0 to host 192.168.49.2 left intact
Signed-off-by: Mohamed Bana mohamed@bana.io
Summary
curl -v -H 'Accept: application/json' 192.168.49.2/todos
should work.Changes
examples/mocking/gateway/**
Example of Gateway mocking taken from [2] and added a deployment manifest.
skaffold.yaml
,skaffold.sh
,Makefile
and.vscode/launch.json
Tidy up
skaffold.yaml
,skaffold.sh
andMakefile
.Add
.vscode/launch.json
that contains debugger configuration for attaching to the manager from within VS Code.References
1: https://github.com/kubeshop/kusk-gateway/issues/298. 2: https://pastebin.com/raw/avYFtZpX.
Test
Signed-off-by: Mohamed Bana mohamed@bana.io