On Tue, 28 Apr 2015 17:07:10 GMT, Dato wrote:

Thank you very much guys. One more thing, I'm not sure I understand what does the string parameter (in this case "user") does in

@before!authenticate("user")

It means the function that's annotated with @before has a parameter named 'user', and the return of authenticate will be passed as parameter. Thus, the return type of authenticate must be the same (or implicitly convertible to, I guess) the type of the parameter 'user'.

and what's the 'result' parameter of addBrackets?

string addBrackets(string result /* THIS ONE */, HTTPServerRequest, HTTPServerResponse)
{
	return "{" ~ result ~ "}";
}

Is this the generated response string?

Thanks again :)

Yes. It's basically the return of the function, so it doesn't have to be a string.