Skip to content

Instantly share code, notes, and snippets.

@shiweifu
Created April 14, 2013 02:50
Show Gist options
  • Save shiweifu/5381186 to your computer and use it in GitHub Desktop.
Save shiweifu/5381186 to your computer and use it in GitHub Desktop.
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