The App object encapsulates the application's event loop. An example app would look like this:
import appier class HelloApp(appier.App): @appier.route("/", "GET") def hello(self): return "Hello World"
To start the app do the following:
HelloApp().serve()
The App can be configured by defining its init method:
class HelloApp(appier.App): def __init__(self, *args, **kwargs): appier.App.__init__( self, name = "app_name", *args, **kwargs )
The basic App
should seldom be inherited from, instead opt for inheriting from APIApp
or WebApp
, depending on whether you're building just an API or a complete Web App with an user interface. These will provide default behaviours that are more appropriate to each scenario. For example, by inheriting from WebApp
instead, the following behaviours are done by default: