Created
January 13, 2015 17:37
-
-
Save val314159/7364b3810a8d54add809 to your computer and use it in GitHub Desktop.
bottle on top of gevent ssl WGSI server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from gevent import monkey; monkey.patch_all() | |
import bottle | |
from bottle import route | |
@route('/qwert') | |
def qwert(): | |
return ['qwert'] | |
@route('/static/<filepath:path>') | |
def server_static(filepath): | |
return bottle.static_file(filepath, root='.') | |
return bottle.static_file(filepath, root='./static') | |
def launch_gevent_ssl(): | |
from gevent import pywsgi | |
print 'Serving on https://0.0.0.0:8443' | |
server = pywsgi.WSGIServer(('0.0.0.0', 8443), bottle.default_app(), | |
keyfile='server.key', certfile='server.crt') | |
# server.start() | |
server.serve_forever() | |
pass | |
if __name__=='__main__': launch_gevent_ssl() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment