hb.web.rest

Automatic REST interface and client code generation facilities.

Public Imports

hb.web.common
public import hb.web.common;
Undocumented in source.

Members

Aliases

after
alias after = vibe.internal.meta.funcattr.after

Allows processing the return value of a handler method and the request/response objects.

before
alias before = vibe.internal.meta.funcattr.before

Allows processing the server request/response before the handler method is called.

Classes

RestInterfaceClient
class RestInterfaceClient(I)

Implements the given interface by forwarding all public methods to a REST server.

RestInterfaceSettings
class RestInterfaceSettings

Encapsulates settings used to customize the generated REST interface.

Functions

generateRestJSClient
void generateRestJSClient(R output, RestInterfaceSettings settings)

Generates JavaScript code to access a REST interface from the browser.

getInterfaceValidationError
string getInterfaceValidationError()
Undocumented in source.
registerRestInterface
URLRouter registerRestInterface(URLRouter router, TImpl instance, RestInterfaceSettings settings)
URLRouter registerRestInterface(URLRouter router, TImpl instance, MethodStyle style)
URLRouter registerRestInterface(URLRouter router, TImpl instance, string url_prefix, MethodStyle style)

Registers a REST interface and connects it the the given instance.

serveRestJSClient
HTTPServerRequestDelegate serveRestJSClient(RestInterfaceSettings settings)
HTTPServerRequestDelegate serveRestJSClient(URL base_url)
HTTPServerRequestDelegate serveRestJSClient(string base_url)

Returns a HTTP handler delegate that serves a JavaScript REST client.

stripTUnderscore
string stripTUnderscore(string name, RestInterfaceSettings settings)
Undocumented in source. Be warned that the author may not have intended to support it.

Structs

Collection
struct Collection(I)

Models REST collection interfaces using natural D syntax.

Templates

GenCmp
template GenCmp(string name, int id, string cmpTo)
Undocumented in source.

Meta

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.

Authors

Sönke Ludwig, Михаил Страшун