Skip to content

Latest commit

 

History

History
46 lines (32 loc) · 808 Bytes

README.rst

File metadata and controls

46 lines (32 loc) · 808 Bytes

Flasky

Trying to understand how python web frameworks work by copying the famous flask micro framework.

How to install?

Create a virtual env and install flit

$ pip install flit
$ git@github.com:sohail535/flasky.git
$ cd flasky
$ flit install --symlink

How to use it?

# 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