summaryrefslogtreecommitdiff
path: root/doc/disfluid.texi
diff options
context:
space:
mode:
Diffstat (limited to 'doc/disfluid.texi')
-rw-r--r--doc/disfluid.texi69
1 files changed, 69 insertions, 0 deletions
diff --git a/doc/disfluid.texi b/doc/disfluid.texi
index be32b85..fa5347a 100644
--- a/doc/disfluid.texi
+++ b/doc/disfluid.texi
@@ -73,6 +73,7 @@ A PDF version of this manual is available at
* Caching on server side::
* The HTTP Link header::
* Content negociation::
+* Server endpoints::
* Running an Identity Provider::
* Running a Resource Server::
* Running a client::
@@ -1493,6 +1494,74 @@ Currently, the only conversions are from and to @emph{Turtle} and
@emph{N-Quads}.
@end deffn
+@node Server endpoints
+@chapter Server endpoints
+
+The disfluid server consists of a set of endpoints that handle
+requests. The @emph{(webid-oidc server endpoint)} module defines the
+base building blocks.
+
+@deftp {Class} <endpoint> () @var{host} @var{path}
+All endpoints define a @var{host} for which they are relevant, and an
+absolute @var{path}. If a request comes with a matching host and a
+matching path prefix, then it will be handled by this endpoint.
+
+If @var{host} is @code{#f}, then this endpoint will be used for all
+hosts.
+
+You can construct an endpoint with the @code{#:@var{host}} and
+@code{#:@var{path}} keyword arguments: the former is a string
+(defaults to @code{#f}), and the latter is a string starting with
+@code{"/"} (defaults to @code{"/"}).
+@end deftp
+
+@deffn {Generic} handle @var{endpoint} @var{request} @var{request-body}
+Handle @var{request} with @var{endpoint}.
+
+@var{request} is the request, in the form of an object from
+@emph{(web request)}. @var{request-body} is @code{#f}, a string or a
+bytevector.
+
+Return 3 values: a response, a response body (a string, bytevector,
+input port, or @code{#f} if no body is expected), and some response
+meta-data.
+@end deffn
+
+@deffn {Generic} host @var{endpoint}
+Return the host name @var{endpoint} is configured to respond to.
+@end deffn
+
+@deffn {Generic} path @var{endpoint}
+Return the path prefix @var{endpoint} is configured to respond to.
+@end deffn
+
+@deffn {Generic} relevant? @var{endpoint} @var{request}
+Check if @var{endpoint} is configured to respond to @var{request}.
+@end deffn
+
+@menu
+* Router endpoint::
+@end menu
+
+@node Router endpoint
+@section Router endpoint
+The first non-trivial handler is for the router endpoint, defined in
+@emph{(webid-oidc server endpoint)}.
+
+@deftp {Class} <router> (<endpoint>) @var{routed}
+The router has a list of endpoints, and chooses which one will handle
+an incoming request based on the request fields. The @var{routed}
+endpoints is a list of endpoints. You can set it at construction time
+with @code{#:@var{routed}}.
+
+The router will check if the @var{routed} endpoints are relevant, in
+turn, or return a 404 Not Found response if no endpoint is relevant.
+@end deftp
+
+@deffn {Generic} routed @var{router}
+Return the list of endpoints for @var{router}.
+@end deffn
+
@node Running an Identity Provider
@chapter Running an Identity Provider