-
Notifications
You must be signed in to change notification settings - Fork 3
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 pathmodules/<name>/bin/<name>
. Alternatively, you can name the executable anything you want (it should still go inmodules/<name>/bin
), and have a shell script named with the same name as the module inmodules/<name>/sh
. If this script has +x set, it will be run instead.