Skip to content

Commit 781caeb

Browse files
author
Raymond Ottun
committed
docs: fixed image paths in docs
1 parent 603e1d7 commit 781caeb

File tree

5 files changed

+70
-36
lines changed

5 files changed

+70
-36
lines changed

README.md

Lines changed: 47 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,45 @@ Deputy is an HTTP API mocking server that can aid in rapid application developme
2525

2626
Deputy can also act as a testing server to validate what requests made by system under test.
2727

28+
![Dev](./docs/static/landing.png)
29+
30+
Here is a sample mock definition
31+
32+
```json
33+
[
34+
{
35+
"request": {
36+
"path": "/user/(\\d+)/slug/(.*)",
37+
"params": {
38+
"output_type": "json|xml"
39+
}
40+
},
41+
"response": {
42+
"status": 200,
43+
"headers": {
44+
"Content-Type": "application/json"
45+
},
46+
"body": [
47+
{
48+
"id": "slug-id",
49+
"content": "The post content"
50+
}
51+
]
52+
}
53+
}
54+
]
55+
```
2856

2957
## Quick Start
58+
3059
With nodejs
60+
3161
```shell
3262
npx @sayjava/deputy
3363
```
3464

3565
With docker
66+
3667
```shell
3768
docker run -p 8080:8080 -p 8081:8081 ghcr.io/sayjava/deputy
3869
```
@@ -54,36 +85,39 @@ curl http://localhost:8080/who-am-i
5485

5586
## Examples
5687

57-
- [with-nextjs-commerce](examples/with-nextjs-commerce)
58-
- [with-nextjs-middleware](examples/with-nextjs-commerce)
88+
- [with-nextjs-commerce](examples/with-nextjs-commerce)
89+
- [with-nextjs-middleware](examples/with-nextjs-commerce)
5990

6091
## Programitcally
92+
6193
```javascript
62-
const express = require('express')
63-
const { createExpressMiddleware } = require('@sayjava/deputy')
94+
const express = require('express');
95+
const { createExpressMiddleware } = require('@sayjava/deputy');
6496

6597
// mount the mock on a middleware endpoint
66-
const app = express()
67-
app.use('/api', createExpressMiddleware({ mocksFolder: 'fixtures' }))
68-
app.listen(3000, () => console.log('server started'))
98+
const app = express();
99+
app.use('/api', createExpressMiddleware({ mocksFolder: 'fixtures' }));
100+
app.listen(3000, () => console.log('server started'));
69101
```
70102

71103
## Usage Scenarios
104+
72105
Here are some setup scenarios that deputy can be used to aid development and testing
106+
73107
### Transparently Mock & Forward API requests
74108

75109
Simulate unready APIs by mocking some APIs and have other requests transparently forwarded to remote APIs
76110
See the examples/commerce folder using that uses the [next/commerce](next/commerces) + deputy
77111

78-
![Dev](./docs/media/dev_environment.png)
112+
![Dev](./docs/static/dev_environment.png)
79113

80114
### Application Testing
81115

82116
Simulate complex HTTP requests and response scenarios in test environments
83117

84-
![Test](./docs/media/test_environment.png)
118+
![Test](./docs/static/test_environment.png)
85119

86-
see the [Mock Guide](http://sayjava.github.com/deputy)
120+
see the [Mock Guide](http://sayjava.github.io/deputy/mocking)
87121

88122
## Deputy UI
89123

@@ -93,19 +127,19 @@ By default, Deputy server can be reached at `http://localhost:8081`.
93127

94128
View and inspect http requests and responses from the Logs interface in realtime as requests are received
95129

96-
![Logs](./docs/media/logs.png)
130+
![Logs](./docs/static/logs.png)
97131

98132
### Visualize
99133

100134
Deputy automatically creates a sequence diagram of requests it receives
101135

102-
![Visualize](./docs/media/visualize.png)
136+
![Visualize](./docs/static/visualize.png)
103137

104138
### Mocking Interface
105139

106140
Mocks can be imported, exported, edited, cloned, disabled, and enabled from Deputy UI
107141

108-
![Mocking Interface](./docs/media/disable_mocks.png)
142+
![Mocking Interface](./docs/static/mock_management.png)
109143

110144
### Full Documentation
111145

docs/content/en/assertions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
title: Testing
2+
title: Assertions
33
position: 10
44
---
55

66
Deputy can be used to in a functional or user acceptance testing environment to validate an application's functionalities without/without making requests to external services.
77

8-
![Test Environment](/test_environment.png)
8+
<img src="test_environment.png" width="1280" height="640" alt="Test Environment"/>
99

1010
Requests made to/via Deputy are recorded and can be asserted against in a test environment.
1111

docs/content/en/dashboard.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ menuTitle: Dashboard
44
category: Getting Started
55
position: 3
66
features:
7-
- Realtime Request Logs
8-
- Create, Edit, Delete, Clone or Disable mocks
9-
- Import and Export mocks
10-
- Visualize requests and responses
11-
- Convert proxy request-response to mock
7+
- Realtime Request Logs
8+
- Create, Edit, Delete, Clone or Disable mocks
9+
- Import and Export mocks
10+
- Visualize requests and responses
11+
- Convert proxy request-response to mock
1212
---
1313

1414
Deputy ships with a beautiful UI at http://localhost:8081 and some very useful features like:
@@ -19,19 +19,19 @@ Deputy ships with a beautiful UI at http://localhost:8081 and some very useful f
1919

2020
Inspect requests and responses
2121

22-
![logs](/logs.png)
22+
<img src="logs.png" width="1280" height="640" alt="Logs"/>
2323

2424
## Request Visualization
2525

2626
Visualize request and responses using the auto generated sequence diagram
2727

28-
![visualize](/visualize.png)
28+
<img src="logs.png" width="1280" height="640" alt="Visualize"/>
2929

3030
## Mock management
3131

3232
Quick access to mocks management straight from the UI
3333

34-
![visualize](/mock_management.png)
34+
<img src="mock_management.png" width="1280" height="640" alt="Mock engagment"/>
3535

3636
<alert type="warning">
3737
The Dashboard only supports JSON mocks

docs/content/en/start.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ menuTitle: Start
44
category: Getting Started
55
position: 2
66
features:
7-
- Start mock API server at http://localhost:8080
8-
- Dashboard and REST API server at http://localhost:8081
7+
- Start mock API server at http://localhost:8080
8+
- Dashboard and REST API server at http://localhost:8081
99
---
1010

1111
## Deputy Server
@@ -50,13 +50,13 @@ an example `hello_world.json` file looks like:
5050

5151
```json
5252
{
53-
"request": {
54-
"path": "/hello-word"
55-
},
56-
"response": {
57-
"status": 200,
58-
"body": "Hello"
59-
}
53+
"request": {
54+
"path": "/hello-word"
55+
},
56+
"response": {
57+
"status": 200,
58+
"body": "Hello"
59+
}
6060
}
6161
```
6262

@@ -111,5 +111,5 @@ Using the `--tls` flag will start the mock server in https mode at `https://loca
111111

112112
If Deputy detects a folder called `ssl` in the current directory, it will use certificates in that folder with the names:
113113

114-
- `key.pem`
115-
- `cert.pem`
114+
- `key.pem`
115+
- `cert.pem`

docs/content/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"title": "Deputy - HTTP Mocking Server",
33
"url": "https://sayjava.github.io/deputy",
44
"logo": {
5-
"light": "/logo-light.svg",
6-
"dark": "/logo-dark.svg"
5+
"light": "/deputy/logo-light.svg",
6+
"dark": "/deputy/logo-dark.svg"
77
},
88
"github": "sayjava/deputy",
99
"twitter": "@sayjava"

0 commit comments

Comments
 (0)