WebServer class
The Serverpod webserver.
Constructors
- WebServer({required Serverpod serverpod})
- Creates a new webserver.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hostname ↔ String
-
The hostname of the webserver.
latefinal
- httpServer → HttpServer
-
Returns the HttpServer this webserver is using to handle connections.
no setter
- port ↔ int
-
The port the webserver is running on.
latefinal
-
routes
→ List<
Route> -
A list of
Route
which defines how to handle path passed to the server.final - running → bool
-
Returns true if the webserver is currently running.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- serverId → int
-
The server id of this server.
final
- serverpod → Serverpod
-
Reference to the
Serverpod
this webserver is associated with.final
Methods
-
addRoute(
Route route, String matchPath) → void - Adds a Route to the server, together with a path that defines how calls are routed.
-
logDebug(
String msg) → void - Logs a message to stdout.
-
logError(
dynamic e, {StackTrace? stackTrace}) → void - Logs an error to stderr.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
start(
) → Future< void> - Starts the webserver.
-
stop(
) → void - Stops the webserver.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited