Skip to content

seansummers/miniature-framework

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 

Repository files navigation

wsgi application with route decorator

In 175 lines of code, with no external dependencies

Example usage

from wsgi import App


app = App()

@app.route('/')
def home(r):
    # do something with headers
    print(r.headers)

    # do something with query
    print(r.query)

    return 'Welcome home', {'custom_headers': 'header_be_here'}
    

@app.route('/form', methods=['POST'])
def form(r):
    # do something with form data and files dictionary
    print(r.data)

    return 'submitted successfully'

if __name__ == '__main__':
    app.run()

About

wsgi application in < 200 lines of code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%