athena.server
ServerBuilder
Builder for configuring the server
Source code in athena/server.py
add_server(configure)
Add a new server configuration
Parameters:
Name | Type | Description | Default |
---|---|---|---|
configure |
Callable[[ServerConfigurator], ServerConfigurator]
|
configure the server |
required |
Source code in athena/server.py
ServerConfigurator
Builder for creating a server configuration
Source code in athena/server.py
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 |
|
delete(path, build_route)
Add an http delete request handler.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
str
|
endpoint for the request |
required |
build_route |
Callable[[RouteBuilder], RouteBuilder]
|
Function to build or modify the request. |
required |
Source code in athena/server.py
get(path, build_route)
Add an http get request handler.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
str
|
endpoint for the request |
required |
build_route |
Callable[[RouteBuilder], RouteBuilder]
|
Function to build or modify the request. |
required |
Source code in athena/server.py
host(host)
Set the host for the server.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
host |
str
|
host the server is running on. Set to 0.0.0.0 to make the server publicly available. |
required |
port(port)
Set the port for the server.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
port |
int
|
port the server is running on. |
required |
post(path, build_route)
Add an http post request handler.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
str
|
endpoint for the request |
required |
build_route |
Callable[[RouteBuilder], RouteBuilder]
|
Function to build or modify the request. |
required |
Source code in athena/server.py
put(path, build_route)
Add an http put request handler.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
str
|
endpoint for the request |
required |
build_route |
Callable[[RouteBuilder], RouteBuilder]
|
Function to build or modify the request. |
required |
Source code in athena/server.py
send(method, path, build_route)
Add an http request handler.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
method |
str
|
HTTP method ('GET', 'POST', etc). |
required |
path |
str
|
endpoint for the request |
required |
build_route |
Callable[[RouteBuilder], RouteBuilder]
|
Function to build or modify the request. |
required |
Source code in athena/server.py
RouteBuilder
Builder for configuring an http route
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request |
ServerRequest
|
accessor for the incoming http request |
required |
body |
ResponseBodyBuilder
|
builder for configuring the response body |
required |
Source code in athena/server.py
header(header_key, header_value)
ResponseBodyBuilder
Builder for configuring the response body
Source code in athena/server.py
data(mimetype, payload)
html(payload)
json(payload)
ServerRequest
Accessor for the request sent to the server
Parameters:
Name | Type | Description | Default |
---|---|---|---|
body |
ServerRequestBody
|
accessor for the request body |
required |
Source code in athena/server.py
cookies
request cookie jar
headers: CIMultiDictProxy
request headers
method
request method (verb)
query: MultiDictProxy
request query data
url
request url
ServerRequestBody
Accessor for the request body
Source code in athena/server.py
data: bytes
raw bytes payload
files
files payload
form: MultiDictProxy
form payload
json
json payload