from bottle import route, run, template, request
@route('/')
def index():
return ('Hi!')
#to test point: http://localhost:8080/
@route('/about')
def about():
return ('About Page!')
#to test point: http://localhost:8080/about
@route('/secrets')
def secret():
try:
key = request.headers["AUTHENTICATION"]
page_info = secretchecker(key)
return (page_info)
except KeyError:
return (" You'll need permission to be here.")
#to test point: http://localhost:8080/secrets
def secretchecker(lock):
if lock == '11':
msg = (" Unlimited powah.
You're an unlimited user. Here's your unlimited info
Huzza!")
elif lock == '22':
msg = (" You are limited.
You're a limited user. Seeing limited info ")
else:
msg = (" You need the right keys. ")
return msg
run(reloader=True, debug=True, host='localhost', port=8080)