Trying to understand how python web frameworks work by copying the famous flask micro framework.
Create a virtual env
and install flit
$ pip install flit $ git@github.com:sohail535/flasky.git $ cd flasky $ flit install --symlink
# hello.py
from flasky import Flasky
class Hello:
def GET(self):
return 'Hello flasky!!'
class Greet:
def GET(self, message):
return 'Hello ' + message + '!!'
urls = [
('/', Hello),
('/greet/<message>', Greet)
]
app = Flasky(urls)
if __name__ == '__main__':
app.debug = True
app.run()
Now run python hello.py