HTTP API doc WIP.
This commit is contained in:
@@ -315,12 +315,17 @@ def kapow():
|
|||||||
"""Start aiohttp app."""
|
"""Start aiohttp app."""
|
||||||
app = web.Application(client_max_size=1024**3)
|
app = web.Application(client_max_size=1024**3)
|
||||||
app.add_routes([
|
app.add_routes([
|
||||||
|
# TODO: Servers
|
||||||
|
|
||||||
|
# Routes
|
||||||
web.get('/kapow/routes', get_routes),
|
web.get('/kapow/routes', get_routes),
|
||||||
web.post('/kapow/routes', create_route),
|
web.post('/kapow/routes', create_route),
|
||||||
web.delete('/kapow/routes/{id}', delete_route),
|
web.delete('/kapow/routes/{id}', delete_route),
|
||||||
web.get('/kapow/connections/{id}/{field:.*}', get_field),
|
|
||||||
|
# Handlers
|
||||||
|
web.get('/kapow/handlers/{id}/{field:.*}', get_field),
|
||||||
# web.post('/kapow/connections/{id}/{field:.*}', append_field),
|
# web.post('/kapow/connections/{id}/{field:.*}', append_field),
|
||||||
web.put('/kapow/connections/{id}/{field:.*}', set_field),
|
web.put('/kapow/handlers/{id}/{field:.*}', set_field),
|
||||||
])
|
])
|
||||||
app.on_startup.append(start_background_tasks)
|
app.on_startup.append(start_background_tasks)
|
||||||
web.run_app(app)
|
web.run_app(app)
|
||||||
|
|||||||
+5
-4
@@ -114,7 +114,10 @@ TODO: Define servers' API
|
|||||||
Routes are the mechanism that allows Kapow! to find the correct program to
|
Routes are the mechanism that allows Kapow! to find the correct program to
|
||||||
respond to an external event (e.g. an incomming HTTP request).
|
respond to an external event (e.g. an incomming HTTP request).
|
||||||
|
|
||||||
#### List of current routes
|
#### List routes
|
||||||
|
|
||||||
|
Returns JSON data about the current routes.
|
||||||
|
|
||||||
##### URL
|
##### URL
|
||||||
##### Method
|
##### Method
|
||||||
##### URL Params
|
##### URL Params
|
||||||
@@ -188,14 +191,12 @@ PUT
|
|||||||
##### Sample Call
|
##### Sample Call
|
||||||
##### Notes
|
##### Notes
|
||||||
|
|
||||||
## Spec'ing the endpoints
|
|
||||||
|
|
||||||
## Usage Example
|
## Usage Example
|
||||||
|
|
||||||
## Test Suite Notes
|
## Test Suite Notes
|
||||||
|
|
||||||
The test suite is located on [blebleble] directory.
|
The test suite is located on [blebleble] directory.
|
||||||
You can run it...
|
You can run it by ...
|
||||||
|
|
||||||
|
|
||||||
# Framework
|
# Framework
|
||||||
|
|||||||
Reference in New Issue
Block a user