The rollup of Protolus (an MV* Framework) which imposes layout and structural standards
The combined Protolus environment (still under development, some of the packages are relatively stable... but at the top level things are still quite rough (including this doc))
Protolus expects a certain directory structure:
The App/routes.conf file has a series of sections which correspond to various groups and their routes.
[*] articles/*/# = "articles?name=*&page=*" [post] articles/upload = "upload?type=article"
shows a couple of routes, one which only applies to a POST action, the other applying to all.
Panels make up the view component of Protolus, and are just a random piece of HTML however large in size you want it to be. Each Panel uses a set of macros to enable logic and subrendering, and before rendering it looks for a matching controller.
For example, if I had a panel 'signup/payment' I would put it at:
and I would put that controller at
The controller is a simple js script who's job is to fetch & stuff any data that the panel will need into the template, which is exposed to the object as 'renderer' and to respond to any incoming input.
Formerly resources lived in their own directory, now Protolus is piggybacking the npm format which means, not only does publishing the module serve double duty, but it also makes it easy to serve existing browser-compatible npm modules. Check the documentation.
var Protolus = require('./protolus-combined'); var application = Protolus.PanelServer(); application.start();
This also gives you access to the protolus libraries at: Protolus.Templates, Protolus.Router, Protolus.Resource, Protolus.Data and Protolus.Application.
Sorry about the slim docs, more to come.
-Abbey Hawk Sparrow