Live Server

This is a minimal version of the Block Server. We use the following behavior hierarchy:

LiveServer.livecode => behavior_DaemonMiddleware => behavior_DaemonRouter => behavior_DaemonServer => behavior_DaemonLog

# Behavior Based

This server is based on behaviours and before and after handlers for customisation. For now we migrate them:

module.exports = { createPage: createPage, doInternalLink: doInternalLink, showPage: showPage, showResult: showResult };

showPage(slug, site, title);

showPage = function showPage(name, loc) { var title = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; return createPage(name, loc, title).appendTo('.main').each(function (_i, e) { return refresh.cycle($(e)); }); };

doInternalLink = function doInternalLink(title, $page) { var site = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; var slug; slug = asSlug(title); if ($page != null) { $($page).nextAll().remove(); } if ($page != null) { lineup.removeAllAfterKey($($page).data('key')); } showPage(slug, site, title); return active.set($('.page').last()); };

<section class='main'> {{#pages}} div class='page' id='{{page}}' tabindex="-1" {{{origin}}} {{{generated}}}> <div class='paper'> {{{story}}} </div> </div> {{/pages}} </section>

{{#pages}} <div class='page' id='{{page}}' tabindex="-1" {{{origin}}} {{{generated}}}> <div class='paper'> {{{story}}} </div> </div> {{/pages}}