Skip to content
tfredrich edited this page Sep 17, 2012 · 18 revisions

Welcome to the RestExpress Plugins Registry!

Cache Control Plugin - Added caching-related headers to your GET responses.

CORS HeaderPlugin

Adds support for CORS (Cross-origin Resource Sharing) setting the 'Access-Control-Allow-Origin' header on the response for GET requests.

Usage requires passing in the appropriate domain names (comma-separated) that are allowed to perform cross-domain behaviors. To support cross-domain behavior globally (not recommended) send in '*'.

Example Usage:

RestExpress server = new RestExpress();
...
new CorsHeaderPlugin("*")
    .register(server);
or...
server.registerPlugin(new CorsHeaderPlugin("*"));

Routes Metadata Plugin

Adds several routes within your service suite to facilitate auto-discovery of what's available:

Example Usage:

new RoutesMetadataPlugin()
    .register(server)
    .parameter(Parameters.Cache.MAX_AGE, 86400);  // Cache for 1 day (24 hours).

Added Routes:

  • /routes/metadata.{format} - lists details on all routes available.

Sample Payload (XML):

Sample Payload (JSON):

  • /routes/{routeName}/metadata.{format} - lists details on a single, named route.

Sample Payload (XML):

Sample Payload (JSON):

Clone this wiki locally