Server class
Handling incoming calls and routing them to the correct Endpoint methods.
Constructors
-
Server({required Serverpod serverpod, required String serverId, required int port, required SerializationManager serializationManager, required DatabasePoolManager? databasePoolManager, required Map<
String, String> passwords, required String runMode, required AuthenticationHandler authenticationHandler, String? name, required Caches caches, SecurityContext? securityContext, List<String> ? whitelistedExternalCalls, required EndpointDispatch endpoints, required Map<String, dynamic> httpResponseHeaders, required Map<String, dynamic> httpOptionsResponseHeaders}) - Creates a new Server object.
Properties
- authenticationHandler → AuthenticationHandler
-
AuthenticationHandler responsible for authenticating users.
final
- caches → Caches
-
Caches used by the server.
final
- endpoints → EndpointDispatch
-
Responsible for dispatching calls to the correct Endpoint methods.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
httpOptionsResponseHeaders
→ Map<
String, dynamic> -
HTTP headers used for OPTIONS responses. These headers are sent in
addition to the httpResponseHeaders when the request method is OPTIONS.
final
-
httpResponseHeaders
→ Map<
String, dynamic> -
HTTP headers used by all API responses. Defaults to allowing any
cross origin resource sharing (CORS).
final
- httpServer → HttpServer
-
The HttpServer responsible for handling calls.
no setter
- messageCentral ↔ MessageCentral
-
Central message dispatch for real time messages.
getter/setter pair
- name → String
-
The name of the server.
final
-
passwords
↔ Map<
String, String> -
Map of passwords loaded from config/passwords.yaml
getter/setter pair
- port → int
-
Port the server is listening on.
final
- runMode → String
-
The ServerpodRunMode the server is running in.
final
- running → bool
-
True if the server is currently running.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- securityContext → SecurityContext?
-
Security context if the server is running over https.
final
- serializationManager → SerializationManager
-
The SerializationManager used by the server.
final
- serverId → String
-
The id of the server. If running in a cluster, all servers need unique
ids.
final
- serverpod → Serverpod
-
The Serverpod managing the server.
final
-
whitelistedExternalCalls
↔ List<
String> ? -
Currently not in use.
getter/setter pair
Methods
-
createDatabase(
Session session) → Database - Creates a new Database object with a connection to the configured database.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
shutdown(
) → Future< void> - Shuts the server down. Returns a Future that completes when the server is shut down.
-
start(
) → Future< bool> - Starts the server. Returns true if the server was started successfully.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited