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

Side by Side 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, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | sky/tools/skydb » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 import argparse
7 import os
8 import cherrypy
9
10 BUILD_DIRECTORY = 'out'
11 CONFIG_DIRECTORY = 'Debug'
esprehn 2014/10/28 19:38:07 This means this can't work for Release? I think ab
12 GEN_DIRECTORY = os.path.abspath(os.path.join(__file__, os.pardir, os.pardir,
13 os.pardir, BUILD_DIRECTORY, CONFIG_DIRECTORY, 'gen'))
14
15 # FIXME: This doesn't yet support directory listings. We'll do something like:
16 # http://tools.cherrypy.org/wiki/staticdirindex
17 # but have it spit .sky instead of HTML
18
19 def main():
20 parser = argparse.ArgumentParser(description='Sky development server')
21 parser.add_argument('app_path', type=str)
22 parser.add_argument('port', type=int)
23 args = parser.parse_args()
24
25 config = {
26 'global': {
27 'server.socket_port': args.port,
28 },
29 '/': {
30 'tools.staticdir.on': True,
31 'tools.staticdir.dir': os.path.abspath(args.app_path),
32 },
33 '/sky': {
34 'tools.staticdir.on': True,
35 'tools.staticdir.dir': os.path.join(GEN_DIRECTORY, 'sky'),
36 },
37 '/mojo': {
38 'tools.staticdir.on': True,
39 'tools.staticdir.dir': os.path.join(GEN_DIRECTORY, 'mojo'),
40 }
41 }
42 cherrypy.quickstart(config=config)
43
44
45 if __name__ == '__main__':
46 main()
OLDNEW
« 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