Last active
August 29, 2015 14:13
-
-
Save chucknado/598393e74e91a7817c71 to your computer and use it in GitHub Desktop.
A Bottle app starter file for the Zendesk OAuth tutorial at https://support.zendesk.com/hc/en-us/articles/204210446
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
from bottle import route, template, redirect, static_file, error, request, response, run | |
@route('/home') | |
def show_home(): | |
return template('home') | |
@route('/') | |
def handle_root_url(): | |
redirect('/home') | |
@route('/zendesk_profile') | |
def make_request(): | |
# make API request | |
profile_data = {'name': 'Lea Lee', 'role': 'admin'} | |
return template('details', data=profile_data) | |
@route('/css/<filename>') | |
def send_css(filename): | |
return static_file(filename, root='static/css') | |
@error(404) | |
def error404(error): | |
return template('error', error_msg='404 error. Nothing to see here') | |
run(host='localhost', port=8080, debug=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment