__init__.py 290 B

123456789101112
  1. from bottle import Bottle, request
  2. app = Bottle()
  3. @app.hook('before_request')
  4. def strip_path():
  5. request.environ['PATH_INFO'] = request.environ['PATH_INFO'].rstrip('/')
  6. def load_config(root):
  7. app.config["kddit.root"] = root
  8. app.config.load_config(f"{root}/app.ini")