You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@climate.apache.org by jo...@apache.org on 2014/02/22 03:44:50 UTC
svn commit: r1570781 -
/incubator/climate/trunk/ocw-ui/backend/run_webservices.py
Author: joyce
Date: Sat Feb 22 02:44:50 2014
New Revision: 1570781
URL: http://svn.apache.org/r1570781
Log:
CLIMATE-332 - Add static file serve endpoints
Modified:
incubator/climate/trunk/ocw-ui/backend/run_webservices.py
Modified: incubator/climate/trunk/ocw-ui/backend/run_webservices.py
URL: http://svn.apache.org/viewvc/incubator/climate/trunk/ocw-ui/backend/run_webservices.py?rev=1570781&r1=1570780&r2=1570781&view=diff
==============================================================================
--- incubator/climate/trunk/ocw-ui/backend/run_webservices.py (original)
+++ incubator/climate/trunk/ocw-ui/backend/run_webservices.py Sat Feb 22 02:44:50 2014
@@ -27,15 +27,36 @@ app.mount('/dir/', dir_app)
app.mount('/rcmed/', rcmed_app)
@app.route('/')
+@app.route('/index.html')
def index():
- return "OCW Backend is running!"
+ raise static_file('index.html', root='./app')
+
+@app.route('/js/:path#.+#')
+def server_static(path):
+ return static_file(path, root='./app/js/')
+
+@app.route('/css/:path#.+#')
+def server_static(path):
+ return static_file(path, root='./app/css/')
+
+@app.route('/img/:path#.+#')
+def server_static(path):
+ return static_file(path, root='./app/img/')
+
+@app.route('/partials/:path#.+#')
+def server_static(path):
+ return static_file(path, root='./app/partials/')
+
+@app.route('/font/:path#.+#')
+def server_static(path):
+ return static_file(path, root='./app/font/')
@app.route('/static/eval_results/<file_path:path>')
def get_eval_result_image(file_path):
''' Return static file.
Return static file specified by root + filepath where root defaults to:
- /tmp/rcmet
+ /tmp/ocw
The 'root' path should coincide with the work directory set used by the
OCW toolkit for processing.