summaryrefslogtreecommitdiff
path: root/toys/server.py
blob: 4afa31b372bbfe89a8f8668b3878ff0c5f92f1c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import os
from klein import run, route
import tasks

FIB = os.environ.get('FIB', tasks.FIB_DEFAULT)


@route('/')
def home(request):
    return 'answer is >>> %s\n' % tasks.fib(FIB)

@route('/hi')
def ping(request):
    return 'easy!'

if __name__ == "__main__":
    run("localhost", 8080)