def main():
if len(sys.argv) > 1:
print "Serves the demo. Needs bottle.py to run. Will serve via bjoern"
print "if installed, otherwise via wsgi_ref. Reads its configuration "
print "from config.ini."
return
# load configuration
port = int(CONFIG.get('port', 9090))
staticdir = os.path.join(os.path.dirname(__file__), 'static')
# start web server
print "Starting web server on localhost:%d..." % port
app.route('/static/:path#.+#', callback=lambda path:
bottle.static_file(path, root=staticdir))
try:
import bjoern
except ImportError:
bjoern = None
bottle.run(app, host='localhost', port=port,
server='bjoern' if bjoern else 'wsgiref')
评论列表
文章目录