Created
April 14, 2013 02:50
-
-
Save shiweifu/5381186 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def simple_app(environ, start_response): | |
"""Simplest possible application object""" | |
status = '200 OK' | |
response_headers = [('Content-type', 'text/plain')] | |
start_response(status, response_headers) | |
return ['Hello world!\n'] | |
import os, sys | |
from bottle import Bottle | |
app = Bottle() | |
app.mount("/admin/", simple_app) | |
app.run(host='localhost', port=8080) | |
#mount 的目录必须不能是/,mount 的对象可以是bottle app,也可以是符合wsgi的app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment