• acre
  • acre.async
  • acre.request
  • acre.request.script
  • acre.request.script.app
  • acre.response
  • acre.current_script
  • acre.current_script.app
  • acre.host
  • acre.freebase
  • acre.keystore
  • acre.oauth
  • acre.form
  • acre.markup
  • acre.html
  • acre.xml
  • acre.hash
  • acre.environ
  • acre.context
  • acre.request_context
  • acre.log
  • console
  • JSON

Acre API Reference - acre

write function(response_text) Find Code
Writes the given string to the HTTP response body.
  • response_text (string, required) - The text to write
exit function() Find Code
Abruptly terminates the execution of the script.
require function(url) Find Code
Loads the script with the given URL and returns the loaded script as an object.
  • url (string, required) - The URL of an Acre-hosted script, either absolute ("http://published-host.freebaseapps.com/foo"), relative to Acre ("//published-host/foo" or "//appY.userX.user.dev/foo"), or relative to the file ("foo").
route function(url) Find Code
Routes the request to the given URL, but does not change the user-visible URL
  • url (string, required) - The Acre-hosted URL to route to... can include path and params.
get_metadata function(url) Find Code
Returns the metadata for an app, including the list of files.
  • url (string, required) - The URL of an app
include function(url) Find Code
Includes the output of a template inline. Currently, only works for templates.
  • url (string, required) - The URL of a template
urlfetch function(url, options) Find Code
Fetches the given url using the given HTTP method, headers, and content as payload.
  • url (string, required) - A valid publicly accessible URL
  • options (obj, required) - The HTTP request options for an urlfetch.
    • method (string, optional) - An HTTP method, such as "GET" and "POST". Default is "GET".
    • headers (obj, optional) - A Javascript object containing key/value pairs, e.g., { "Content-Length" : 25 }
    • content (string, optional) - The body of the HTTP request, applicable for POST
    • sign (boolean, optional) - Whether or not Acre should try to 'sign' the request using OAuth credentials set by acre.oauth.get_credentials() [defaults to 'false']
    • timeout (number, optional) - (Async only). Number of ms to give the request before throwing (or calling errback with) a timeout error
version string Find Code
Version of the Acre system
error hash Find Code
The dictionary of properties of the error (only present when executing an error script).
form_url function(base_url, url_parameters) Find Code
Deprecated, use acre.form.build_url
  • base_url (string, required) - the base URL
  • url_parameters (obj, required) - a javascript object
htmlencode function(text) Find Code
Deprecated, use acre.form.encode
  • text (string, required) - some text to encode
formquote function(string) Find Code
Deprecated, use acre.form.quote
  • string (string, required) - some text to decode
formencode function(obj) Find Code
Deprecated, use acre.form.encode
  • obj (obj, required) - a javascript object to encode
formdecode function(string) Find Code
Deprecated, use acre.form.decode
  • string (string, required) - a string to decode
start_response function(status, headers) Find Code
Deprecated, use acre.response
  • status (number, optional) - the HTTP status code of the response.
  • headers (obj, optional) - the HTTP headers to set on the response.