Relax Programmatic DSL (Deprecated)
Relax Programmatic DSL
Example Using the Forgebox API:
this.relax = {
// Service Title
title = "ForgeBox IO",
// Service Description
description = "This API powers ForgeBox",
// Service entry point, can be a single string or name value pairs to denote tiers
//entryPoint = "http://www.myapi.com",
entryPoint = {
"production" : "https://forgebox.io/api/v1",
"staging" : "http://forgebox.stg.ortussolutions.com/api/v1",
"development" : "http://localhost:9095/api/v1"
},
// Does it have extension detection via ColdBox
extensionDetection = true,
// Valid format extensions
validExtensions = "json",
// Does it throw exceptions when invalid extensions are detected
throwOnInvalidExtension = false
};
/************************************** GLOBAL PARAMS + HEADERS *********************************************/
// Global API Headers
globalHeader( name="x-app-token", description="The secret application token", required=true, type="string" );
/************************************** RESOURCES *********************************************/
// ECHO
resource( pattern="/echo", handler="Main", action="echo" )
.description( "Simple API echo command" )
.defaultFormat( "json" )
.methods( "GET" );Configuration
Arguments
Global Headers
Arguments
Global Params
Arguments
Last updated