Skip to content

Commit

Permalink
configurable port
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Buchleitner <[email protected]>
  • Loading branch information
mabunixda committed Jan 10, 2024
1 parent 44b8416 commit 9d040b7
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions dapr-distributed-calendar/python/messages.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import json
import os

import flask
from flask import request, jsonify
from flask_cors import CORS
import json
import sys
import time

from dapr.clients import DaprClient

app = flask.Flask(__name__)
CORS(app)

dapr_port = os.getenv("DAPR_HTTP_PORT", 5000)

# dapr calls this endpoint to register the subscriber configuration
# an alternative way would to be declare this inside a config yaml file
@app.route('/dapr/subscribe', methods=['GET'])
Expand All @@ -25,4 +27,5 @@ def subscriber():
print(request.json, flush=True)
return json.dumps({'success':True}), 200, {'ContentType':'application/json'}

app.run()
if __name__ == "__main__":
app.run(port=dapr_port)

0 comments on commit 9d040b7

Please sign in to comment.