Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(528)

Unified Diff: sky/tools/sky_server

Issue 682153003: Add a sky_server for running sky apps (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sky/tools/skydb » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/tools/sky_server
diff --git a/sky/tools/sky_server b/sky/tools/sky_server
new file mode 100755
index 0000000000000000000000000000000000000000..c826d56736fb6c2371701edb34b3652e9493fe3e
--- /dev/null
+++ b/sky/tools/sky_server
@@ -0,0 +1,46 @@
+#!/usr/bin/env python
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import argparse
+import os
+import cherrypy
+
+BUILD_DIRECTORY = 'out'
+CONFIG_DIRECTORY = 'Debug'
esprehn 2014/10/28 19:38:07 This means this can't work for Release? I think ab
+GEN_DIRECTORY = os.path.abspath(os.path.join(__file__, os.pardir, os.pardir,
+ os.pardir, BUILD_DIRECTORY, CONFIG_DIRECTORY, 'gen'))
+
+# FIXME: This doesn't yet support directory listings. We'll do something like:
+# http://tools.cherrypy.org/wiki/staticdirindex
+# but have it spit .sky instead of HTML
+
+def main():
+ parser = argparse.ArgumentParser(description='Sky development server')
+ parser.add_argument('app_path', type=str)
+ parser.add_argument('port', type=int)
+ args = parser.parse_args()
+
+ config = {
+ 'global': {
+ 'server.socket_port': args.port,
+ },
+ '/': {
+ 'tools.staticdir.on': True,
+ 'tools.staticdir.dir': os.path.abspath(args.app_path),
+ },
+ '/sky': {
+ 'tools.staticdir.on': True,
+ 'tools.staticdir.dir': os.path.join(GEN_DIRECTORY, 'sky'),
+ },
+ '/mojo': {
+ 'tools.staticdir.on': True,
+ 'tools.staticdir.dir': os.path.join(GEN_DIRECTORY, 'mojo'),
+ }
+ }
+ cherrypy.quickstart(config=config)
+
+
+if __name__ == '__main__':
+ main()
« no previous file with comments | « no previous file | sky/tools/skydb » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698