How to use the consolidate.dot function in consolidate

To help you get started, we’ve selected a few consolidate 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 bkchain / bkchain.org / blockexplorer.js View on Github external
fs.writeFileSync(__dirname + '/views/' + output, template.toString());
}

// Generate dynamic website templates
generateTemplate('livetx.html', 'livetx.js', defs);
generateTemplate('liveblock.html', 'liveblock.js', defs);

// Include router.js content
eval(fs.readFileSync(__dirname + '/views/router.js') + '');

var engines = require('consolidate');

app.set('views', view);
app.set('view options', {layout: false});
app.set("view engine", "html");
app.engine('.html', engines.dot);

app.use('/static', express.static(__dirname + '/static'));

function get_ws_api_url(currency) {
  if (api_local_hosted) {
    // Hosted locally, redirect to appropriate port (bkchaind daemon)
    switch (currency) {
    case 'btc':
      return 'http://127.0.0.1:8352';
    case 'ltc':
      return 'http://127.0.0.1:9352';
    case 'ppc':
      return 'http://127.0.0.1:9922';
    case 'doge':
      return 'http://127.0.0.1:22575';
    default:
github RagnarDanneskjold / AirWallet / blockexplorer.js View on Github external
fs.writeFileSync(__dirname + '/views/' + output, template.toString());
}

// Generate dynamic website templates
generateTemplate('livetx.html', 'livetx.js', defs);
generateTemplate('liveblock.html', 'liveblock.js', defs);

// Include router.js content
eval(fs.readFileSync(__dirname + '/views/router.js') + '');

var engines = require('consolidate');

app.set('views', view);
app.set('view options', {layout: false});
app.set("view engine", "html");
app.engine('.html', engines.dot);

var bodyParser = require('body-parser')
app.use( bodyParser.json() );       // to support JSON-encoded bodies
app.use( bodyParser.urlencoded({ extended: false }) ); // to support URL-encoded bodies

app.use('/static', express.static(__dirname + '/static'));


// Add headers
app.use(function (req, res, next) {

    // Website you wish to allow to connect
    res.setHeader('Access-Control-Allow-Origin', 'http://api.airwallet.me');

    // Request methods you wish to allow
    res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, PATCH');

consolidate

Modern and maintained fork of the template engine consolidation library. Maintained and supported by Forward Email <https://forwardemail.net>, the 100% open-source and privacy-focused email service.

MIT
Latest version published 8 months ago

Package Health Score

79 / 100
Full package analysis