Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paulyuk/hello world refactor #478

Merged
merged 3 commits into from
Oct 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions hello-world/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ expected_stdout_lines:
expected_stderr_lines:
name: "npm install"
-->
Open a new terminal and navigate to the `./hello-world/node` directory and follow the steps below:

1. Install dependencies:

Expand Down Expand Up @@ -203,7 +204,7 @@ dapr dashboard -p 9999

Now that Dapr and the Node.js app are running, you can send POST messages against it, using different tools. **Note**: here the POST message is sent to port 3500 - if you used a different port, be sure to update your URL accordingly.

First, POST the message by using Dapr cli in a new command line terminal:
First, POST the message by using Dapr cli in a new terminal:

<!-- STEP
expected_stdout_lines:
Expand Down Expand Up @@ -250,7 +251,7 @@ Last but not least, you can use the Postman GUI.

Open Postman and create a POST request against `http://localhost:3500/v1.0/invoke/nodeapp/method/neworder`
![Postman Screenshot](./img/postman1.jpg)
In your terminal window, you should see logs indicating that the message was received and state was updated:
In your terminal, you should see logs indicating that the message was received and state was updated:
```bash
== APP == Got a new order! Order ID: 42
== APP == Successfully persisted state.
Expand Down Expand Up @@ -305,7 +306,7 @@ This invokes the `/order` route, which calls out to the Redis store for the late

## Step 6 - Run the Python app with Dapr

Take a look at the Python App to see how another application can invoke the Node App via Dapr without being aware of the destination's hostname or port. In the `app.py` file you can find the endpoint definition to call the Node App via Dapr.
Take a look at the Python App in the `./hello-world/python` directory to see how another application can invoke the Node App via Dapr without being aware of the destination's hostname or port. In the `app.py` file you can find the endpoint definition to call the Node App via Dapr.

```python
dapr_port = os.getenv("DAPR_HTTP_PORT", 3500)
Expand All @@ -329,7 +330,7 @@ while True:
time.sleep(1)
```

Now open a **new** command line terminal and go to the `hello-world` directory.
Now open a **new** terminal and go to the `./hello-world/python` directory.

<!-- STEP
name: "Install python requirements"
Expand Down Expand Up @@ -395,11 +396,11 @@ sleep: 30
}
```

> **Note**: It is not required to run `dapr init` in the **second** command line terminal because dapr was already setup on your local machine initially, running this command again would fail.
> **Note**: It is not required to run `dapr init` in the **second** terminal because dapr was already setup on your local machine initially, running this command again would fail.

## Step 7 - Cleanup

To stop your services from running, simply stop the "dapr run" process. Alternatively, you can spin down each of your services with the Dapr CLI "stop" command. For example, to spin down both services, run these commands in a new command line terminal:
To stop your services from running, simply stop the "dapr run" process. Alternatively, you can spin down each of your services with the Dapr CLI "stop" command. For example, to spin down both services, run these commands in a new terminal:

<!-- STEP
expected_stdout_lines:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading