Last active
February 6, 2017 03:56
-
-
Save m-ueno/0ec3922c30c37424f13bcaecc98ab4db to your computer and use it in GitHub Desktop.
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
import hug | |
from hug.api import API | |
from logging import getLogger, StreamHandler, DEBUG, INFO | |
from werkzeug.wsgi import DispatcherMiddleware | |
from flask import Flask | |
from flask.ext.autoindex import AutoIndex | |
API(__name__) # __hug_wsgi__ special variable becomes accessible below this line | |
# autoindex current dir | |
app_index = Flask(__name__) | |
AutoIndex(app_index, browse_root=os.path.curdir) | |
# expose WSGI app | |
app = DispatcherMiddleware(app_index, { | |
'/static': app_index, | |
'': __hug_wsgi__, | |
}) | |
@hug.get('/hello') | |
def hello(): | |
return 'hello' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment