Reference¶
Application Class¶
-
class
styrofoam.
Application
(func, url, modify_urls=True, minify=False)[source]¶ This class represents a WSGI application. It holds the WSGI handler function of the app, the url prefix that the app is mounted at, and some other configuration options. A
Router
object holds an array ofApplication
objects, along with the default WSGI application.Parameters: - func – The WSGI handler function (the one with the
environ
and thestart_request
arguments) - url – The url to mount the application at. It must have a beginning
forward slash, but must not have one at the end
(e.g.
/path/to/app
). - modify_urls – Whether or not to parse the app’s output and correct
urls in it (e.g. in an
<a>
tag) to go to urls within the one the app is mounted at. For example, an application that is mounted at/oof
will have<a href="/no">
replaced to<a href="/oof/no">
. It currently has not been implemented yet. When this parameter is set toTrue
(the default), the app’s output will be minified regardless of theminify
attribute.
- func – The WSGI handler function (the one with the