How to use the sails.Sails function in sails

To help you get started, we’ve selected a few sails 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 jaumard / sails-hook-schedule / test / basic.js View on Github external
before(function (done)
	{

		// Hook will timeout in 10 seconds
		this.timeout(11000);

		// Attempt to lift sails
		Sails().lift({
			hooks  : {
				// Load the hook
				"sails-hook-schedule" : require('../'), // Skip grunt (unless your hook uses it)
				"grunt"          : false
			}, log : {level : "error"}

		}, function (err, _sails)
		{
			if (err)
			{
				return done(err);
			}
			sails = _sails;
			return done();
		});
	});
github robophil / sails-hook-jsonwebtoken / test / basic.js View on Github external
before(function (done) {

        // Hook will timeout in 10 seconds
        this.timeout(13000);

        // Attempt to lift sails
        Sails().lift({
            hooks: {
                // Load the hook
                "sails-hook-jsonwebtoken": require('../'),
                // Skip grunt (unless your hook uses it)
                "grunt": false
            },
            log: { level: "info" }
        }, function (err, _sails) {
            if (err) return done(err);
            sails = _sails;
            return done();
        });
    });
github emahuni / sails-util-micro-apps / test / helpers / bootstrap.js View on Github external
before(function (done) {
  // Hook will timeout in 10 seconds
  this.timeout(30000);

  // change the working dir to test so we load test app
  process.chdir('./test/fixtures/app');

  // Attempt to lift sails
  Sails().load({
    port: 1300,
    log: {
      // level: 'debug',
      level: 'verbose',
      custom: console,
      inspect: false,
    },
    hooks: {
      // load this hook before sails ORM
      "beforeORM": require('../fixtures/sails-hook-before-orm'),
      // load the ORM
      "orm": require('sails-hook-orm'),
      // Load this hook after sails ORM
      "afterORM": require('../fixtures/sails-hook-after-orm'),
    },
github sailshq / treeline1 / legacy / lib / actions / run.js View on Github external
delayedLog(50)('Synchronizing app with Treeline mothership...'.grey);
  delayedLog(450)('Calibrating machines...'.grey);
  delayedLog(2500)('Hold tight, this can take a moment...'.grey);

  // Give up after 30 seconds
  delayedLog.timers.push(setTimeout(function () {
    log.error('The preview server isn\'t starting...');
    log.error('Please try again later.  If the problem persists, check @treelineHQ for updates.');
    for (var i in delayedLog.timers) {
      clearTimeout(delayedLog.timers[i]);
    }
    return;
  }, 30000));


  var sails = new Sails();
  var watch = watcher(sails);
  var treelineCliConfig = {
    src: {
      secret: conf.credentials.secret,
      baseURL: conf.config.treelineURL,
      url: conf.config.treelineURL + '/' + conf.targetProject.id + '/modules',
      projectId: conf.targetProject.id,
      protocol: 'https://',
      host: 'api.treeline.io',
      port: 443,
      prefix: '',
      endpoint: '/modules'
    }
  };

  var options = conf.targetProject.options || {};
github luislobo / sails-hook-fixtures / test / sampleApp.spec.js View on Github external
function loadSails (done, fixtures) {
  if (!fixtures) {
    fixtures = require('./helpers/fixtures');
  }
  //link node modules to the app dir
  try {
    fs.symlinkSync(path.join(__dirname, '../node_modules'), path.join(__dirname, 'helpers/sampleApp/node_modules'), 'file');
  } catch (e1) {
    if (e1.code !== 'EEXIST') {
      throw e1;
    }
  }
  console.info('Loading Sails');
  //Try to lift
  new Sails().load({
    appPath: path.join(__dirname, 'helpers/sampleApp'),
    hooks: {
      'fixtures': require('../lib'),
      'grunt': false,
      'views': false,
      'blueprints': false,
    },
    log: {
      level: 'info'
    },
    connections: {
      test: {
        adapter: 'sails-mongo',
        host:'localhost',
        port: 27017,
        database: 'sails-hook-fixtures-testdb'
github luislobo / sails-hook-fixtures / test / basic.spec.js View on Github external
before(function(done) {
    console.log(__dirname);
    //set 10sec timeout
    this.timeout(10000);

    //Try to lift
    new Sails().load({
      hooks: {
        'fixtures': require('../lib'),
        'grunt': false
      },
      log: {
        level: 'error'
      }
    }, function (err, _sails) {
      if (err) { return done(err); }
      sails = _sails;
      return done();
    });
  });
github tjwebb / sails-backbone / test / index.js View on Github external
describe('sails-backbone', function () {
  var schema;
  var app = new SailsApp();
  var config = {
    appPath: path.dirname(require.resolve('hashware-api')),
    hooks: {
      grunt: false
    }
  };

  before(function (done) {
    this.timeout(60 * 1000);

    app.load(config, function (error, sails) {
      app = sails;
      done(error);
    });
  });
github GetStream / Winds / load_initial_data.js View on Github external
var Sails      = require('sails').Sails,
    app        = Sails(),
    argv       = require('yargs').argv,
    striptags  = require('striptags'),
    moment     = require('moment'),
    urlLibrary = require('url'),
    async      = require('async');

var initialData = {
    'Design': [
        {'name': 'Designer News', 'rss': 'https://www.designernews.co/?format=rss'},
        {'name': 'Dribbble', 'rss': 'https://dribbble.com/shots/popular.rss'},
        {'name': 'A List Apart', 'rss': 'http://alistapart.com/main/feed'},
        {'name': 'Smashing Magazine', 'rss': 'https://www.smashingmagazine.com/feed/'},
        {'name': 'Invision', 'rss': 'http://blog.invisionapp.com/feed/'}
    ],
    'Startups': [
        {'name': 'On Startups', 'rss': 'http://onstartups.com/rss.xml'},
github GetStream / Winds / scrape_feeds.js View on Github external
const Sails     = require('sails').Sails,
    app       = Sails(),
    striptags = require('striptags'),
    moment    = require('moment'),
    async     = require('async'),
    cheerio   = require('cheerio'),
    kue = require('kue')

var argv = require('yargs')
    .usage('Usage: $0  [options]')
    .command('scrape_feeds', 'Scrape all RSS feeds that we didn\'t update in the past 5 minutes')
    .example('$0 -f -c 50', 'Scrape all feeds, 50 at the time')
    .example('$0 -q cnn -a 1', 'Get 1 article from CNN')
    .alias('l', 'live')
    .boolean('l')
    .default('l', false)
    .describe('l', 'keeps the process alive')
    .alias('f', 'force')
github GetStream / Winds / cleanup_feeds.js View on Github external
var Sails     = require('sails').Sails,
    app       = Sails(),
    striptags = require('striptags'),
    moment    = require('moment'),
    request = require('request'),
    async     = require('async'),
    cheerio   = require('cheerio')


var scrapingErrors = {}

app.load({
    hooks: { grunt: false },
    log: { level: 'warn' }
}, function sailsReady(err) {

    if (err) {
        sails.log.warn('Error loading app:', err)