Network Developer Guide
This page describes resources of interest to developers working with Cantabile's Network API and Network Server.
The network level API allows minimal control of Cantabile using a REST API and full control via a WebSocket interface.
Documentation is available here.
Cantabile's built-in web server serves static content from special
.webfolder folders in the resource folder.
.webfolder can be either a sub-directory of the resource folder, or zipped set of files renamed with a .webfolder extension.
When the web server starts, any
.webfolder files/folders are mounted using the name of the web folder as the url. For example, everything in zipped web folder
lib.webfolder would be available as http://localhost:35007/lib/
The special web folder
Root.webfolder is mounted as the root url and contains the default
Files ending in
.html can be accessed using a url without the
.html extension and URLs referring to a directory will server the default file
index.html if it exists.
Building Files on Demand
For non-zipped webfolders (ie: actual directories), files can be created/updated on demand by placing a .make or a .bat file of the same name.
For example, in the
Root.webfolder the file
styles.css is generated from the file
styles.less. By placing a file
styles.css.make in the same folder, Cantabile will automatically run the make file to generate the dependant file.
styles.css.make might contain:
styles.css : styles.less lessc styles.less styles.css
Similarly a styles.css.bat could be used for similar purposes. Use of a .make file requires a GNU compatible version make is available on the system path (and the above example also assumes lessc is available on the system path).
Built-in Web Content
The built-in web content can be used as a reference and is available here.
Of particular interest might be: