Apps contain a set of (regex) URL patterns that map HTTP requests to handler methods, called views. URL patterns and views are stored in separate files, which are imported when the app is executed. Apps can be organised into a set of modules, each with their own URL and view definitions. You can build quite complex apps by hooking a module's URL patterns one of the parent module's URL patterns (in the same way that django does).
Examples are be stored in the apps directory, and will give you a starting point for building your applications. To run the examples you must have node.js installed. Navigate to the example directory in your terminal of choice, and run:
Then visit http://127.0.0.1:8009/ in your web browser.
Fork the project, have a play around, and please contribute!
<app_directory> | |- app.js |- urls.js |- views.js | |- <module_directory> | | | |- urls.js | |- views.js | |- templates | |- <base_template>.html | |- <module_directory> | |- <template>.html |- <template>.html
Templates don't have to be laid out this way, but the templating example uses this layout. Also, this structure doesn't show static content. This would be placed in a sub folder of the app directory. Look at either of the examples to see how they fit in.
jimi is currently considering various node.js data modelling libraries, so please forward any suggestions to firstname.lastname@example.org.