I use totally default Kraken.js app.
I want to define some configs for .dust
templates (select options) in a config.js
file. Then I need to get these configs in my controller. How may I get a config in a controller? Here is an example code:
'use strict';
var Post = require('../../models/post');
var mongoose = require("mongoose");
// How to get config, for example, here??
var config = require(".....config.....")
module.exports = function (router) {
// or how to get a config here as the third argument of a function, for example?
router.get('/', function (req, res) {
// Here I want to get data from config
res.render('posts', {
foo: config.foo,
bar: config.selects.selectOne.bar
});
}