How to use the derby.util function in derby

To help you get started, we’ve selected a few derby examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github derbyjs / derby-site / src / app / index.js View on Github external
var derby = require('derby');
var markedOptions = require('./../../config/markedOptions');
var path = require('path');
var app = module.exports = derby.createApp('site', __filename);

if (!derby.util.isProduction) global.app = app;

app.serverUse(module, 'derby-markdown', markedOptions);
app.serverUse(module, 'derby-stylus');
app.loadViews(path.join(__dirname, '/../../views/app'));
app.loadStyles(path.join(__dirname, '/../../styles/app'));
app.component(require('../../components/chat'));
app.component(require('../../components/preferences'));
app.component(require('../../components/sidebar'));

app.get('*', function (page, model, params, next) {
  // it`s used to cheat template engine in derby-template examples
  model.set('_session.openBrackets', '{{');
  if (model.get('_session.loggedIn')) {
    var userId = model.get('_session.userId');
    $user = model.at('users.' + userId);
    model.subscribe($user, function () {

derby

MVC framework making it easy to write realtime, collaborative applications that run in both Node.js and browsers.

MIT
Latest version published 2 days ago

Package Health Score

73 / 100
Full package analysis