Skip to content

Commit

Permalink
refine the ui, link the players to the api server static dir
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Dec 25, 2013
1 parent 7b2f9d5 commit 4b4f317
Show file tree
Hide file tree
Showing 10 changed files with 514 additions and 15 deletions.
4 changes: 4 additions & 0 deletions trunk/auto/depends.sh
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@ else
echo "#undef SRS_HTTP" >> $SRS_AUTO_HEADERS_H
fi

echo "link players to cherrypy static-dir"
rm -f research/api-server/static-dir/players &&
ln -sf `pwd`/research/players research/api-server/static-dir/players

#####################################################################################
# openssl, for rtmp complex handshake
#####################################################################################
Expand Down
6 changes: 5 additions & 1 deletion trunk/research/api-server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,8 @@ def __init__(self):

# parse port from user options.
port = int(sys.argv[1])
trace("api server listen at port: %s"%(port))
static_dir = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), "static-dir"))
trace("api server listen at port: %s, static_dir: %s"%(port, static_dir))

# cherrypy config.
conf = {
Expand All @@ -483,9 +484,12 @@ def __init__(self):
'server.socket_host': '0.0.0.0',
'server.socket_port': port,
'tools.encode.on': True,
'tools.staticdir.on': True,
'tools.encode.encoding': "utf-8"
},
'/': {
'tools.staticdir.dir': static_dir,
'tools.staticdir.index': "index.html",
# for cherrypy RESTful api support
'request.dispatch': cherrypy.dispatch.MethodDispatcher()
}
Expand Down
Loading

0 comments on commit 4b4f317

Please sign in to comment.