Skip to content

Commit

Permalink
improved app doc
Browse files Browse the repository at this point in the history
  • Loading branch information
tsilva committed Dec 3, 2014
1 parent bbc6d23 commit d09adfc
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions doc/app.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,27 @@ To start the app do the following:
```python
HelloApp().serve()
```

The App can be configured by defining its init method:

```python
class HelloApp(appier.App):

def __init__(self):
appier.App.__init__(
self,
name = "app_name"
)
```

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:

* Provide a default handler for the index route, so that the developer can visit the app
through the browser the moment he launches it (without writing any handlers yet).
* Redirects the user to the login page when acess is denied to a particular resource.
* Provides a default HTML error page.
* Defaults 'service' to False.

0 comments on commit d09adfc

Please sign in to comment.