Skip to content
crazy2be edited this page Jun 15, 2011 · 2 revisions

Modules

The WFDR framework is designed to make writing additional modules as bits of functionality as easy as possible. Each module represents a subset of the functionality available on the site, and is represented on the client-side by a different top-level "folder". For example, a website might have a news module, available at /news/*, and a photos module, available at /photos/*. Requests to the folder or subfolders thereof automatically get forwarded to the module. Each module is located in modules/, and includes everything needed for the module to properly function, including css, js, images, (mustache) templates, and source code. You can look at some of the other modules to get an idea of how things work, but they can really work any way you wish, as long as you do the following:

  • Put your source files in modules/<name>/src, and have an accompanying Makefile that will compile the source files.
  • The compiled executable should go in modules/<name>/bin. This executable should have the same name as the module, making the full path modules/<name>/bin/<name>. Alternatively, you can name the executable anything you want (it should still go in modules/<name>/bin), and have a shell script named with the same name as the module in modules/<name>/sh. If this script has +x set, it will be run instead.
Clone this wiki locally