DartIOServer class

Class that defines the configuration and http server instance

Constructors

DartIOServer({required Config config})
DartIoServer construtor class. Requires a config.yaml file.

Properties

config Config
Config class - defines database configuration
final
getSlash String
Getter used to change "" to "/" in paths if Windows is the platform.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
uuid ↔ Uuid
Uuid object from the package Uuid
getter/setter pair

Methods

checkFile(dynamic request) bool
Method for checking a file. Uses the parameter request, but it's NOT a Shelf package request. It uses a dynamic parameter to get a uri.pathSegments
getSegment(Request request) Future
Gets a segment of the requested url. Requires a http Request (from the Shelf package).
handleAuth(Request request) Future<Response>
Handles Authorizations. Requires a http Request (from the Shelf package). The user must use an email and a password, and if the response is ok it returns an user, a token and an exp fields.
handleDelete(Request request) Future<Response>
Handles Delete http requisitions. Requires a http Request (from the Shelf package).
handleGet(Request request) Future<Response>
Handles Get http requisitions. Requires a http Request (from the Shelf package).
handlePatch(Request request) Future<Response>
Handles Patch http requisitions. Requires a http Request (from the Shelf package).
handlePost(Request request) Future<Response>
Handles Post http requisitions. Requires a http Request (from the Shelf package).
handlePut(Request request) Future<Response>
Handles Put http requisitions. Requires a http Request (from the Shelf package).
handleRequest(Request request) FutureOr<Response>
Main method to handle the Requests. Requires a http Request (from the Shelf package) and based on the method requested calls the appropriate function.
handleUpload(Request request) Future<Response>
Handles Uploads. Requires a http Request (from the Shelf package).
middlewareJwt(Request request) bool
Contains the logic used to validate a Jason Web Token
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
start() Future
Initiates the server using the config.db.init, creating a handler (middleware) for the requests and starting a shelf server on the localhost
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

getInstance() Future<DartIOServer>
Getter that uses the config.yaml data to return a DartIOServer instance