Skip to content

Commit 962517f

Browse files
committed
added ability to select multiple domains from the domain_bridge
1 parent a67f55a commit 962517f

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

flask_server.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,20 @@
1111
from flask import Flask, jsonify, request, redirect
1212
import sys
1313

14+
print """
15+
Starting Flask Server...
16+
Note, you may be able to specify a domain at this point by adding it as a
17+
positional argument.
18+
"""
19+
20+
# Specify which domain should be selected from the domain bridge.
21+
# This is an optional argument that is used for domain_bridges that sit
22+
# atop a collection of MDP domains. You should leave this as the
23+
# empty string unless you must select between domains.
24+
domain = ""
25+
if len(sys.argv) > 1:
26+
domain = sys.argv[1]
27+
1428
# Add the parent folder path to the sys.path list so
1529
# we can include its bridge
1630
sys.path.insert(0, '..')

serve.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ echo "This script starts a simple Python server that will let you open MDPvis lo
33
echo "Once the server starts you can visit http://localhost:8000/index.html in your browser."
44
echo "to quit the server you should press ctrl-c."
55
echo ""
6+
echo "You should not use this server to start an MDP domain since this will only serve the visualization."
67
python -m SimpleHTTPServer

tornado_server.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,9 @@
44
from flask_server import app
55

66
http_server = HTTPServer(WSGIContainer(app))
7+
# There is an optional parameter for selecting between multiple domains in the
8+
# domain bridge
9+
if len(sys.argv) > 2:
10+
domain = sys.argv[2]
711
http_server.listen(5000)
812
IOLoop.instance().start()

0 commit comments

Comments
 (0)