betty.serve module
Provide the Serve API to serve resources within the application.
-
class betty.serve.AppServer(app)[source]
Bases: Server
- Parameters:
- app
-
-
static get(app)[source]
- Parameters:
- app
-
- Return type:
betty.serve.AppServer
-
async start()[source]
Start the server.
- Return type:
None
-
class betty.serve.BuiltinAppServer(app)[source]
Bases: AppServer
- Parameters:
- app
-
-
classmethod label()[source]
- Return type:
betty.locale.Str
-
property public_url : str
-
async start()[source]
Start the server.
- Return type:
None
-
async stop()[source]
Stop the server.
- Return type:
None
-
class betty.serve.BuiltinServer(www_directory_path, *, root_path=None, localizer)[source]
Bases: Server
- Parameters:
- www_directory_path
-
- root_path=None
-
- localizer
-
-
classmethod label()[source]
- Return type:
betty.locale.Str
-
property public_url : str
-
async start()[source]
Start the server.
- Return type:
None
-
async stop()[source]
Stop the server.
- Return type:
None
-
exception betty.serve.NoPublicUrlBecauseServerNotStartedError[source]
Bases: ServerNotStartedError
-
exception betty.serve.OsError(message)[source]
Bases: UserFacingError, OSError
- Parameters:
- message
-
-
class betty.serve.Server(localizer)[source]
Bases: object
Provide a development web server.
- Parameters:
- localizer
-
-
async assert_available()[source]
- Return type:
None
-
classmethod label()[source]
- Return type:
betty.locale.Str
-
classmethod name()[source]
- Return type:
str
-
property public_url : str
-
async show()[source]
Show the served site to the user.
- Return type:
None
-
async start()[source]
Start the server.
- Return type:
None
-
async stop()[source]
Stop the server.
- Return type:
None
-
exception betty.serve.ServerNotStartedError[source]
Bases: RuntimeError
-
class betty.serve.ServerProvider[source]
Bases: object
-
property servers : Sequence[Server]