Skip to content

Commit 80aab01

Browse files
committed
update using suggestion from shubham
Signed-off-by: Hannah Hunter <[email protected]>
1 parent 996f6bf commit 80aab01

File tree

4 files changed

+38
-69
lines changed

4 files changed

+38
-69
lines changed

daprdocs/content/en/js-sdk-docs/js-client/_index.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,37 +39,36 @@ const server = new DaprServer(serverHost, serverPort, daprHost, daprPort, Commun
3939
const client = new DaprClient(daprHost, daprPort, CommunicationProtocolEnum.GRPC);
4040
```
4141

42-
{{% alert title="Note" color="primary" %}}
43-
By default, the example will run using HTTP. To use gRPC:
42+
## Running using HTTP or gRPC
4443

45-
- Add `CommunicationProtocolEnum.GRPC` to the DaprClient object creation. For example:
44+
By default, the example uses HTTP. To run:
4645

47-
```javascript
48-
const client = new DaprClient(daprHost, process.env.DAPR_HTTP_PORT, CommunicationProtocolEnum.GRPC);
49-
```
46+
```bash
47+
# Using dapr run
48+
dapr run --app-id example-config --app-port 50051 --app-protocol http npm run start
5049

51-
- Instead of running:
50+
# or, using npm script
51+
npm run start:dapr-http
52+
```
5253

53-
```bash
54-
# HTTP using dapr run
55-
dapr run --app-id example-config --app-port 50051 --app-protocol http npm run start
54+
To use gRPC instead:
5655

57-
# or npm script
58-
npm run start:dapr-http
56+
- Add `CommunicationProtocolEnum.GRPC` to the DaprClient object creation:
57+
58+
```javascript
59+
const client = new DaprClient(daprHost, process.env.DAPR_HTTP_PORT, CommunicationProtocolEnum.GRPC);
5960
```
60-
61-
Run:
61+
62+
- To run:
6263

6364
```bash
64-
# gRPC using dapr run
65+
# Using dapr run
6566
dapr run --app-id example-config --app-port 50051 --app-protocol grpc npm run start
6667

67-
# or npm script
68+
# or, using npm script
6869
npm run start:dapr-grpc
6970
```
7071

71-
{{% /alert %}}
72-
7372
### DaprClient Library
7473
A library that provides methods for how an application communicates with the Dapr sidecar.
7574

examples/configuration/README.md

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,20 @@ npm run start:dapr-http
2020

2121
## Switching from HTTP to gRPC
2222

23-
By default, the example will run using HTTP. To use gRPC:
23+
By default, the example will run using HTTP. To use gRPC instead:
2424

25-
- Add `CommunicationProtocolEnum.GRPC` to the DaprClient object creation. For example:
25+
- Add `CommunicationProtocolEnum.GRPC` to the DaprClient object creation:
2626

2727
```javascript
28-
const client = new DaprClient(daprHost, process.env.DAPR_HTTP_PORT, CommunicationProtocolEnum.GRPC);
28+
const client = new DaprClient(daprHost, process.env.DAPR_HTTP_PORT, CommunicationProtocolEnum.GRPC);
2929
```
3030

31-
- Instead of running:
31+
- To run:
3232

3333
```bash
34-
# using dapr run
35-
dapr run --app-id example-config --app-port 50051 --app-protocol http npm run start
36-
37-
# or npm script
38-
npm run start:dapr-http
39-
```
40-
41-
Run:
42-
43-
```bash
44-
# using dapr run
34+
# Using dapr run
4535
dapr run --app-id example-config --app-port 50051 --app-protocol grpc npm run start
4636

47-
# or npm script
37+
# or, using npm script
4838
npm run start:dapr-grpc
49-
```
39+
```

examples/invocation/README.md

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,22 @@ dapr run --app-id example-invocation --app-port 50051 --app-protocol http npm ru
1818
npm run start:dapr-http
1919
```
2020

21-
## Switching to gRPC
21+
## Switch to gRPC
2222

23-
By default, the example will run using HTTP. To use gRPC:
23+
By default, the example uses HTTP. To use gRPC instead:
2424

25-
- Add `CommunicationProtocolEnum.GRPC` to the DaprClient object creation. For example:
25+
- Add `CommunicationProtocolEnum.GRPC` to the DaprClient object creation:
2626

2727
```javascript
28-
const client = new DaprClient(daprHost, process.env.DAPR_HTTP_PORT, CommunicationProtocolEnum.GRPC);
28+
const client = new DaprClient(daprHost, process.env.DAPR_HTTP_PORT, CommunicationProtocolEnum.GRPC);
2929
```
3030

31-
- Instead of running:
31+
- To run:
3232

3333
```bash
34-
# using dapr run
35-
dapr run --app-id example-invocation --app-port 50051 --app-protocol http npm run start
36-
37-
# or npm script
38-
npm run start:dapr-http
39-
```
40-
41-
Run:
42-
43-
```bash
44-
# using dapr run
34+
# Using dapr run
4535
dapr run --app-id example-invocation --app-port 50051 --app-protocol grpc npm run start
4636

47-
# or npm script
37+
# or, using npm script
4838
npm run start:dapr-grpc
49-
```
39+
```

examples/pubsub/README.md

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,30 +27,20 @@ npm run start:dapr-http
2727

2828
## Switching to gRPC
2929

30-
By default, the example will run using HTTP. To use gRPC:
30+
By default, the example uses HTTP. To use gRPC instead:
3131

32-
- Add `CommunicationProtocolEnum.GRPC` to the DaprClient object creation. For example:
32+
- Add `CommunicationProtocolEnum.GRPC` to the DaprClient object creation:
3333

3434
```javascript
35-
const client = new DaprClient(daprHost, process.env.DAPR_HTTP_PORT, CommunicationProtocolEnum.GRPC);
35+
const client = new DaprClient(daprHost, process.env.DAPR_HTTP_PORT, CommunicationProtocolEnum.GRPC);
3636
```
3737

38-
- Instead of running:
38+
- To run:
3939

4040
```bash
41-
# using dapr run
42-
dapr run --app-id example-pubsub --app-port 50051 --app-protocol http --components-path ./components npm run start
43-
44-
# or npm script
45-
npm run start:dapr-http
46-
```
47-
48-
Run:
49-
50-
```bash
51-
# using dapr run
41+
# Using dapr run
5242
dapr run --app-id example-pubsub --app-port 50051 --app-protocol grpc --components-path ./components npm run start
5343

54-
# or npm script
44+
# or, using npm script
5545
npm run start:dapr-grpc
5646
```

0 commit comments

Comments
 (0)