Commit Graph

15 Commits

Author SHA1 Message Date
Sebastián Ramírez 4af75d72a9 Add tests for fixed path handling and docs (#280)
* Add tests for fixed path handling and docs

* Mark as not covered route made to never match

* Simplify docs -> routing: example for /users/me
2018-12-18 12:33:32 +00:00
Tom Christie 9f3dcb7d2b
Rejig ExceptionMiddleware and ServerErrorMiddleware (#193)
* Rejig ExceptionMiddleware and ServerErrorMiddleware

* Tweak DebugMiddleware implementation

* Support custom 500 handlers

* Exception handling updates
2018-11-08 11:59:15 +00:00
Tom Christie 5584568f8a
Drop add_graphql_route, in favor of more consistent API style (#170) 2018-11-01 12:52:16 +00:00
Tom Christie 8da0f00fe7
Routing interface (#144)
* Path -> Route, PathPrefix -> Mount

* Route, WebSocketRoute, Mount

* Use Route(endpoint=...), not Route(app=...)

* Bare minimum docs update

* Add url_for

* request.path_params and session.path_params

* Version 0.6.0
2018-10-29 09:22:45 +00:00
Alexander Botello bc26ab3319 Support either `cleanup` or `shutdown` in ASGI lifespan messages (#134)
* support either cleanup or shutdown in ASGI message

* change event_type in tests

* update docs

* fix typo

* keep  as event_type for now

* exclude line 65

* blackify

* replace cleanup with shutdown in docs
2018-10-22 15:08:04 +01:00
Alexander Botello 49f76ab5e9 Add documentation to reflect `add_event_handler` (#129)
* Update applications docs

* Update events docs

* slight reword

* make requested changes

* split into two examples
2018-10-21 08:37:29 +01:00
Tom Christie fa2a5a8070 Include 'add_graphql_route' 2018-10-18 17:06:17 +01:00
Tom Christie 139753f857
Add support for `app.on_event("startup")` and `app.on_event("cleanup")`. (#98)
* Push black linting into ./scripts/test Fix some annotations etc.

* Skip black on 3.7

* Fix script

* Blergh. Shell equality tests are weird

* Attempt to fix equality check

* Document 'allow_origin_regex'

* Support app.on_event('startup') and app.on_event('cleanup')

* Nicer decorator handling for on_event

* Add documentation for app.on_event()
2018-10-09 15:47:51 +01:00
Tom Christie 19670ae2cd
Middleware (#82)
* Tweaks to URL datastructure

* Linting

* Add Middleware
2018-10-05 12:04:11 +01:00
Tom Christie a7722cd245 Minor changes to docs layout 2018-09-05 13:45:39 +01:00
Tom Christie 78d1829758
Version 0.3 (#57)
* Renamings

* Version 0.3.0

* Black formatting

* Update docs for 0.3
2018-09-05 11:39:38 +01:00
Jordan Eremieff f4fe0ec312 Name changes (#55)
* Rename View -> HTTPEndpoint

* Rename views doc file -> endpoints

* Rename request/response files -> requests/responses, update imports, update docs

* Rename WebSocketSession -> WebSocket, rename session -> websocket in docs

* Full module imports in tests and source, removing imports from __init__ file

* Fix name in testclient doc
2018-09-05 10:29:04 +01:00
Tom Christie 67d95fcfa7
Exception handling (#54)
* Exception handling

* Black formatting

* Add exception handling to App

* Handle cases where exception raised but response already started

* Order exception handler lookup by class inheritance

* Handle 404/405 as responses without App, or exceptions with it.

* Only use TestClient(app, raise_exceptions=False) explicitly inside test cases

* Documentation for ExceptionMiddleware

* Drop error_handler/exception_handler distinction.

* Finesse and document TestClient(app, raise_server_exceptions=False)

* Refactoring to make debug responses easier to obtain from elsewhere in code

* Use named status_code argument in example

* Clean up raise_server_errors usage in tests

* Consistent title-casing in HTTP reason phrases

* Black formatting

* Add WebSocketClose close. Omit message-body on 204, 304 exception cases.

* Black formatting

* Add 'debug' flag to App and ExceptionMiddleware

* Support app.debug

* Document debug mode

* Documenting debug
2018-09-04 11:52:29 +01:00
Tom Christie 2002eb1bd2 Drop licence footer from page content 2018-08-29 11:31:08 +01:00
Jeff Buttars 1f6fabc5e1 Add Applications docs to mkdocs 2018-08-28 08:11:53 -06:00