Server

class teachbooks.serve.Server(servedir: Path | str, workdir: Path | str, port: int | None = None)

Class for managing a Python webserver in the background.

Attributes:
is_running

Check if the current process ID is a running webserver.

url

Get URL of running server.

Methods

load(workdir)

Construct a Server object from an existing pickle file.

start([options])

Start server.

stop([options])

Stop server and clean up.

teachbooks.serve.Server.start([options])

Start server.

teachbooks.serve.Server.stop([options])

Stop server and clean up.