Skip to content

Instantly share code, notes, and snippets.

@mruser
mruser / bottle_trailing_slash.py
Last active August 6, 2016 03:18
Unfortunately, this seems like the best way to do trailing slash routing in bottle 0.9.6
import bottle
# monkey patch bottle to strip trailing slash if result not found
app = bottle.app()
router_match = app.router.match
def our_match(environ):
try:
targets, urlargs = router_match(environ)
except HTTPError as e:
if e.status == 404 and environ['PATH_INFO'].endswith('/'):
set -g default-terminal "screen-256color"
set -s escape-time 0
set -g base-index 1
setw -g aggressive-resize on
set-option -g status-bg default
set-option -g status-fg black
set-option -g message-bg yellow
set-option -g message-fg black
set-option -g history-limit 32768