server library
JSON:API server on top of dart:io. WARNING: This library is in beta stage. The API is subject to change.
Classes
- Controller
- JSON:API controller
Properties
- corsMiddleware → Middleware
-
final
- requestValidator → Middleware
-
final
Functions
-
badRequest(
[OutboundErrorDocument? document]) → Response -
conflict(
[OutboundErrorDocument? document]) → Response -
created(
OutboundDocument document, String location) → Response -
errorConverter(
{Future< Response?> onMethodNotAllowed(MethodNotAllowed)?, Future<Response?> onUnmatchedTarget(UnmatchedTarget)?, Future<Response?> onCollectionNotFound(CollectionNotFound)?, Future<Response?> onResourceNotFound(ResourceNotFound)?, Future<Response?> onRelationshipNotFound(RelationshipNotFound)?, Future<Response?> onError(Object, StackTrace)?}) → Middleware - Creates a middleware that maps server exceptions to HTTP responses.
-
internalServerError(
[OutboundErrorDocument? document]) → Response -
methodNotAllowed(
[OutboundErrorDocument? document]) → Response -
noContent(
) → Response -
notAcceptable(
[OutboundErrorDocument? document]) → Response -
notFound(
[OutboundErrorDocument? document]) → Response -
ok(
OutboundDocument document) → Response -
response(
int statusCode, {OutboundDocument? document}) → Response - JSON:API response
-
router(
Controller controller, Target? matchTarget(Uri uri)) → Handler -
unsupportedMediaType(
[OutboundErrorDocument? document]) → Response
Exceptions / Errors
- CollectionNotFound
- A collection is not found on the server.
- MethodNotAllowed
- NotAcceptable
- RelationshipNotFound
- A relationship is not found on the server.
- ResourceNotFound
- A resource is not found on the server.
- UnmatchedTarget
- UnsupportedMediaType