Skip to content

Instantly share code, notes, and snippets.

@nnsnodnb
Created August 27, 2016 03:21
Show Gist options
  • Save nnsnodnb/636d723fd5381fb8b838c4fef20a3b3e to your computer and use it in GitHub Desktop.
Save nnsnodnb/636d723fd5381fb8b838c4fef20a3b3e to your computer and use it in GitHub Desktop.
from bottle import route, run, HTTPResponse
@route('<url:path>')
def callback(url):
body = 'ただいまアクセスが集中しているため、サイトが繋がりづらい状態になっています。 ご迷惑をおかけして申し訳ありません。'
r = HTTPResponse(status=503, body=body)
r.set_header('Content-Type', 'document')
return r
if __name__ == '__main__':
run(host="0.0.0.0", port=5000, reloader=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment