Renderowanie widoku bez pisania handlera
Gdy trasa nie ma handlera, Total.js renderuje dla niej widok: views/about.html dla /about/ i views/index.html dla /. Możesz też sam nazwać widok, przekazując napis zamiast funkcji.
<!DOCTYPE html><html><body>@{body}</body></html><h1>Home</h1><h1>About us</h1><h1>Contact</h1>exports.install = function() {
ROUTE('GET /');
ROUTE('GET /about/');
ROUTE('GET /contact/', 'contact-page');
};