... is simple

/**
 *@RequestMapping(value="/hello-world") 
 */
HalloWorldController.prototype.sayHello = function(request, response){
	response.end("Hello world!");
};
see code
see live

Features

routing

Routing with Aries as simple as writing comments. You just put variable name in curvy braces and put it as a parametr in your constructor. Aries dynamically assigns the value to variable.

/**
 *@RequestMapping(value="/twitter/{userId}") 
 */
HalloWorldController.prototype.twitterUser = function(request, response, userId){
	//we can use userId here
	//ex. response.end("Hi "+ userId);
};	
		
see code
see live

asynchronous

Every request comes through a chain of functions to pass request to the next function you need to call this.doNext method along with request and response.

/**
 *@RequestMapping(value="/twitter/tweets") 
 */
HalloWorldController.prototype.twitterFeed = function(request, response, twitId){
	//you can pass flow to view resolver asynchronously
	this.doNext(request, response);				
};
see code
see live

smart binding

Aries provides some magic that allow to get post and get params inside controller by just declaring those as a parameter for controller function

/**
 *@RequestMapping(value="/twitter/tweets") 
 */
HalloWorldController.prototype.twitterFeed = function(request, response, twitId){
	//you can use twitId here if it is passed as POST or GET parameter
	//ex. response.end("Hi "+ twitId);
};
see code
see live

middleware

Standard request flow goes through following chain:

[filters]->[controller resolver]->[pre controller interceptors]->[controller]->[post controller interceptors]->[view resolver] which gives us flexibility of using middleware as filters, pre and post controller interceptors. For example we can use connect's static middleware to handle static content as a filter which is the best to handle before controller resolver. To assign class as filter we just need to put Filter annotation before constructor.

var connect = require("connect");
var static = connect.static(__dirname + "/src/static");
/**
 * @Filter
 */
function StaticFilter(){}

StaticFilter.prototype.filter=function(request, response){
	var that=this;
	static(request, response, 
		function(){
			that.doNext(request, response);
		}
	);
}
see code
see live? you are already seeing it. this site's static served by connect middleware

there is more comming

Installation

npm install -g aries

now start server with

aries-start src=./src port=8000

where src is a folder with sources of your server and port... is a port