You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tfredrich edited this page Sep 17, 2012
·
3 revisions
Welcome to the RestExpress Plugins wiki!
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):
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("*"));