Skip to content

Instantly share code, notes, and snippets.

@Madhuka
Created November 14, 2013 06:57
Show Gist options
  • Save Madhuka/7462585 to your computer and use it in GitHub Desktop.
Save Madhuka/7462585 to your computer and use it in GitHub Desktop.
Simple REST app from Jaggery page
<%
var method = request.getMethod();
var name = request.getParameter("name");
var log = new Log();
switch(method) {
case 'POST' :
log.info('getting call over '+method);
print('testing API with POST ' + name);
break;
case 'GET' :
log.info('getting call over '+method);
print('testing API with GET');
response.addHeader("customheader", "jaggery_response");
break;
}
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment