Skip to content

kevinisaac/wsgi-static-middleware

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

wsgi-static-middleware

A simple WSGI middleware that I wrote for my Falcon app, with some help online ofcourse, to serve static files.

To use this middleware in your Falcon app:

import falcon

from static_middleware import StaticMiddleware

app = falcon.API()
app = StaticMiddleware(app)

By default, all static files are assumed to be stored in the static directory in the root of the app. You can optionally set the keyword argument static_dir to the directory in which the static directory is present.

For example, if the static directory is present inside the files directory of the static directory:

import falcon

from static_middleware import StaticMiddleware

app = falcon.API()
app = StaticMiddleware(app, static_dir='files')

Hope this works! Tested with Python3.5. Hopefully it works in other versions of Python too.

Pull requests are welcome.

About

A simple WSGI middleware to serve static files.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages