How to use the keystone.set function in keystone

To help you get started, we’ve selected a few keystone 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 skagitpublishing / connextCMS / keystone-files / keystone.js View on Github external
fs.readFile('public/js/publicsettings.json', 'utf8', function(err, data) {
  //debugger;

  if(err) {
    console.log('Error in keystone.js while trying to read publicsettings.json file.');
    console.log(err);
  } else {

    var publicSettings = JSON.parse(data);

    if(typeof(publicSettings.superUsers) == "string") {
      keystone.set('superusers', [publicSettings.superUsers]);
    } else {
      keystone.set('superusers', publicSettings.superUsers);
    }

    if(typeof(publicSettings.adminUsers) == "string") {
      keystone.set('admins', [publicSettings.adminUsers]);
    } else {
      keystone.set('admins', publicSettings.adminUsers);
    }

    // Start Keystone to connect to your database and initialise the web server
    // Need to be inside the readFile function handler.
    keystone.start();
  }
});
github colovo / KeystoneShop / keystone.js View on Github external
keystone.import('models');

// Setup common locals for your templates. The following are required for the
// bundled templates and layouts. Any runtime locals (that should be set uniquely
// for each request) should be added to ./routes/middleware.js

keystone.set('locals', {
	_: require('underscore'),
	env: keystone.get('env'),
	utils: keystone.utils,
	editable: keystone.content.editable
});

// Setup Store Gateway
keystone.set('store gateway', 'stripe')
// Setup Default Country
keystone.set('store country', 'Canada')

// Setup Stripe keys
keystone.set('stripe secret key', process.env.STRIPE_SECRET_KEY || 'STRIPE_SECRET_KEY')
keystone.set('stripe publishable key', process.env.STRIPE_PUBLISHABLE_KEY || 'STRIPE_PUBLISHABLE_KEY')

// Load your project's Routes
keystone.set('routes', require('./routes'));

// Configure the navigation bar in Keystone's Admin UI

keystone.set('nav', {
	'posts': ['posts', 'post-categories'],
	'galleries': 'galleries',
	'enquiries': 'enquiries',
github laurenskling / keystone-with-react-engine / keystone.js View on Github external
// Load your project's Models
keystone.import('models');

// Setup common locals for your templates. The following are required for the
// bundled templates and layouts. Any runtime locals (that should be set uniquely
// for each request) should be added to ./routes/middleware.js
keystone.set('locals', {
	_: require('lodash'),
	env: keystone.get('env'),
	utils: keystone.utils,
	editable: keystone.content.editable,
});

// Load your project's Routes
keystone.set('routes', require('./routes'));

// Configure the navigation bar in Keystone's Admin UI
keystone.set('nav', {
	users: 'users',
});

// Start Keystone to connect to your database and initialise the web server

keystone.start();
github promethe42 / dredd / api / index.js View on Github external
'auth': true,
	'user model': 'User',
	'cookie secret': '0T=?C|`ed@N&,<!)BQ<Nh/7+e3TeO"$^cl{7Z$7i@mfnybN1{*H.ETQ=(->75^MB'
});

keystone.import('models');

keystone.set('locals', {
	// _: require('underscore'),
	env: keystone.get('env'),
	utils: keystone.utils,
	editable: keystone.content.editable
});

keystone.set('routes', require('./routes'));
keystone.set('nav', {
	// 'bills': 'bills'
});

keystone.start();
github internetErik / keystone4-universal-react / server / index.js View on Github external
// Load your project's Models
keystone.import('models');

// Setup common locals for your templates. The following are required for the
// bundled templates and layouts. Any runtime locals (that should be set uniquely
// for each request) should be added to ./routes/middleware.js
keystone.set('locals', {
  _: require('lodash'),
  env: keystone.get('env'),
  utils: keystone.utils,
  editable: keystone.content.editable,
});

// Load your project's Routes
keystone.set('routes', require('./routes'));

// Configure the navigation bar in Keystone's Admin UI
keystone.set('nav', {
  'pages': [
    'home-pages',
    'faq-pages',
    'contact-pages',
  ],
  'data' : [
    'faqs',
    'media-items',
    'contact-enquiries',
  ],
  'configuration' : [ 'site-configurations' ],
  'users' : [ 'users' ],
});
github kespinola / react-keystone / keystone.js View on Github external
keystone.import('models');

// Setup common locals for your templates. The following are required for the
// bundled templates and layouts. Any runtime locals (that should be set uniquely
// for each request) should be added to ./routes/middleware.js

keystone.set('locals', {
	_: require('underscore'),
	env: keystone.get('env'),
	utils: keystone.utils,
	editable: keystone.content.editable
});

// Load your project's Routes

keystone.set('routes', require('./routes'));

// Setup common locals for your emails. The following are required by Keystone's
// default email templates, you may remove them if you're using your own.

keystone.set('email locals', {
	logo_src: '/images/logo-email.gif',
	logo_width: 194,
	logo_height: 76,
	theme: {
		email_bg: '#f9f9f9',
		link_color: '#2697de',
		buttons: {
			color: '#fff',
			background_color: '#2697de',
			border_color: '#1a7cb7'
		}
github zapkub / cu-vivid-museum-wiki / src / keystone.js View on Github external
// bundled templates and layouts. Any runtime locals (that should be set uniquely
// for each request) should be added to ./routes/middleware.js


keystone.set('locals', {
	_: require('lodash'),
	env: keystone.get('env'),
	utils: keystone.utils,
	editable: keystone.content.editable,
});

// Load your project's Routes
keystone.set('routes', require('./cms/routes'));

// Configure the navigation bar in Keystone's Admin UI
keystone.set('nav', {
	Plant: ['plants', 'plant-categories' ],
	users: 'users',
});

export default (app) => {

	keystone.app = app;

	return keystone;
};
github keystonejs / keystone-test-project / tests / email / index.js View on Github external
from: {
			name: 'Keystone Test Project',
			email: 'test@keystonejs.com',
		},
		subject: 'Keystone Test Email!',
	}, function (err, result) {
		if (err) {
			console.error('🤕 Mailgun test failed with error:\n', err);
		} else {
			console.log('📬 Successfully sent Mailgun test with result:\n', result);
		}
	});
}

if (mandrillApiKey) {
	keystone.set('mandrill api key', mandrillApiKey);

	new keystone.Email({
		templateName: template,
		templateExt: 'pug',
		transport: 'mandrill',
	}).send({}, {
		to: [to],
		from: {
			name: 'Keystone Test Project',
			email: 'test@keystonejs.com',
		},
		subject: 'Keystone Test Email!',
	}, function (err, result) {
		if (err) {
			console.error('🤕 Mandrill test failed with error:\n', err);
		} else {
github skagitpublishing / connextCMS / routes / api / serversettings.js View on Github external
}
    });
    
    
    //Update the list of superusers stored in memory
    if(typeof(data.superUsers) == "string") {
      keystone.set('superusers', [data.superUsers]);
    } else {
      keystone.set('superusers', data.superUsers);
    }
    
    console.log('superusers = '+keystone.get('superusers'));
    
    //Update the list of admins stored in memory
    if(typeof(data.adminUsers) == "string") {        
      keystone.set('admins', [data.adminUsers]);
    } else {        
      keystone.set('admins', data.adminUsers);        
    }
    
    console.log('admins = '+keystone.get('admins'));
    
    //Temporary code for debugging.
    var admins = keystone.get('admins');
    var superusers = keystone.get('superusers');
    console.log('admins = '+admins);
    console.log('superusers = '+superusers);
    
  //Rejects the API if the user is not a superuser.
  }, function(err) {
    console.log('/api/serversettings/saveprivate exited with error '+err);
github JedWatson / keystone-forum / keystone.js View on Github external
chartbeat_property: keystone.get('chartbeat property'),
	chartbeat_domain: keystone.get('chartbeat domain')
});

keystone.set('email locals', {
	keystoneURL: 'http://www.keystonejs.com/keystone',
	logo: '/images/logo_email.jpg',
	logo_width: 120,
	logo_height: 112,
	theme: {
		email_bg: '#f9f9f9',
		link_color: '#2697de'
	}
});

keystone.set('email tests', {
	'forgotten-password': {
		name: 'User',
		link: 'http://forum.keystonejs.com/reset-password/key'
	}
});

keystone.set('nav', {
	'users': ['users'],
	'topics': ['topics', 'replies', 'tags']
});

keystone.start();