1

The documentation has little information on this subject. If I copy application.serve declaration into my script, I get an error:

Cannot find function serve in object [object Application]

The script file is very simple:

<%
application.serve(function(request, respond, session) {});
%>

I found a presentation with an example on slide #23, but it says I have to require a router. When I do this I get another error.

How is "application.serve" to be used in a proper way?

1 Answers1

0

application.serve is the centralized entry point in proposed front-controller model. This new model is not finalized and still in an architectural review state.

Under the current model you can directly write function body logic inside Jaggery code block. request, respond, session are visible to the code section as top level variables.

eg:

<html>
  <body>
   <%
     print("Method : " + request.getMethod() + "<br/>");
   %>
  </body>
</html>
Manu
  • 382
  • 5
  • 12
  • This feature looks like the Express framework in Node.js or like the Bullet framework in PHP. It would be nice to have this feature. – extjstricks Sep 10 '14 at 13:37