mirror of https://github.com/dapr/quickstarts.git
addresses case inconsistency in pubsubname var (#308)
This commit is contained in:
parent
a10181528c
commit
45972d3668
|
|
@ -205,12 +205,12 @@ Navigate to the `node-subscriber` directory and open `app.js`, the code for the
|
||||||
app.get('/dapr/subscribe', (_req, res) => {
|
app.get('/dapr/subscribe', (_req, res) => {
|
||||||
res.json([
|
res.json([
|
||||||
{
|
{
|
||||||
pubsubName: "pubsub",
|
pubsubname: "pubsub",
|
||||||
topic: "A",
|
topic: "A",
|
||||||
route: "A"
|
route: "A"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pubsubName: "pubsub",
|
pubsubname: "pubsub",
|
||||||
topic: "B",
|
topic: "B",
|
||||||
route: "B"
|
route: "B"
|
||||||
}
|
}
|
||||||
|
|
@ -240,7 +240,7 @@ Navigate to the `python-subscriber` directory and open `app.py`, the code for th
|
||||||
```python
|
```python
|
||||||
@app.route('/dapr/subscribe', methods=['GET'])
|
@app.route('/dapr/subscribe', methods=['GET'])
|
||||||
def subscribe():
|
def subscribe():
|
||||||
subscriptions = [{'pubsubName': 'pubsub', 'topic': 'A', 'route': 'A'}, {'pubsubName': 'pubsub', 'topic': 'C', 'route': 'C'}]
|
subscriptions = [{'pubsubname': 'pubsub', 'topic': 'A', 'route': 'A'}, {'pubsubname': 'pubsub', 'topic': 'C', 'route': 'C'}]
|
||||||
return jsonify(subscriptions)
|
return jsonify(subscriptions)
|
||||||
```
|
```
|
||||||
Again, this is how you tell Dapr what topics in which pubsub component to subscribe to. In this case, subscribing to topics "A" and "C" of pubsub component named 'pubsub'. Messages of those topics are handled with the other two routes:
|
Again, this is how you tell Dapr what topics in which pubsub component to subscribe to. In this case, subscribing to topics "A" and "C" of pubsub component named 'pubsub'. Messages of those topics are handled with the other two routes:
|
||||||
|
|
|
||||||
|
|
@ -15,12 +15,12 @@ const port = 3000;
|
||||||
app.get('/dapr/subscribe', (_req, res) => {
|
app.get('/dapr/subscribe', (_req, res) => {
|
||||||
res.json([
|
res.json([
|
||||||
{
|
{
|
||||||
pubsubName: "pubsub",
|
pubsubname: "pubsub",
|
||||||
topic: "A",
|
topic: "A",
|
||||||
route: "A"
|
route: "A"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pubsubName: "pubsub",
|
pubsubname: "pubsub",
|
||||||
topic: "B",
|
topic: "B",
|
||||||
route: "B"
|
route: "B"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ CORS(app)
|
||||||
|
|
||||||
@app.route('/dapr/subscribe', methods=['GET'])
|
@app.route('/dapr/subscribe', methods=['GET'])
|
||||||
def subscribe():
|
def subscribe():
|
||||||
subscriptions = [{'pubsubName': 'pubsub', 'topic': 'A', 'route': 'A'}, {'pubsubName': 'pubsub', 'topic': 'C', 'route': 'C'}]
|
subscriptions = [{'pubsubname': 'pubsub', 'topic': 'A', 'route': 'A'}, {'pubsubname': 'pubsub', 'topic': 'C', 'route': 'C'}]
|
||||||
return jsonify(subscriptions)
|
return jsonify(subscriptions)
|
||||||
|
|
||||||
@app.route('/A', methods=['POST'])
|
@app.route('/A', methods=['POST'])
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue