connection .authenticate() .then(() => { console.info('INFO - Database connected.') }) .catch(err => { console.error('ERROR - Unable to connect to the database:', err) })
// Bootstrap lando at the correct level lando.bootstrap(bsLevel).then(lando => { // If bootstrap level is APP then we need to get and init our app to generate the app task cache if (bsLevel === 'APP') { lando.getApp().init().then(() => cli.run(bootstrap.getTasks(config, cli.argv()), config)); // Otherwise run as yooz } else { cli.run(bootstrap.getTasks(config, cli.argv()), config); } });
// Start listening Promise.fromNode(cb => { api.listen(config.LANDO_API_PORT, cb); }) // Load our routes .then(() => { fs.readdirSync(path.join(__dirname, 'routes')).map(file => { require(`./routes/${file}`)(api, handler, {config, slack}); log.info('Loaded route %s', file); }); log.info('Listening on port: %s', config.LANDO_API_PORT); });
request({ method:"GET", url:req.clientParam.url }).then(function (response) { return response.body; })
Promise.resolve(buildCmds).each(cmd => shell.sh(cmd.run, cmd.opts)) // Move the built assetz .then(() => Promise.resolve(distCopy)).each(item => fs.copySync(item.src, item.dest, {overwrite: true})) // Catch errors and exit .catch(err => { log.error(err); process.exit(444); })
/** * Subscribe to balanced action commands * * @param {String} action * @memberof AmqpTransporter */ subscribeBalancedRequest(action) { const queue = `${this.prefix}.${PACKET_REQUEST}B.${action}`; return this.channel.assertQueue(queue, this._getQueueOptions(PACKET_REQUEST, true)) .then(() => this.channel.consume( queue, this._consumeCB(PACKET_REQUEST, true), this.opts.consumeOptions )); }
function post(url, jar, form, options) { var op = { headers: getHeaders(url, options), timeout: 60000, url: url, method: "POST", form: form, jar: jar, gzip: true }; return request(op).then(function(res) { return res[0]; }); }
Promise.all( globs.map(g => glob(g.pattern, g.options)) ).then(all => getUniques([].concat.apply([], all)))
retryEach(data, datum => compose('pull', datum)) // then build .then(() => retryEach(data, datum => compose('build', datum)))
// Main logix Promise.fromNode(cb => { api.listen(config.LANDO_METRICS_PORT, cb); }) .then(() => { log.info('Listening on port: %s', config.LANDO_METRICS_PORT); });
connection .authenticate() .then(() => { console.info('INFO - Database connected.') }) .catch(err => { console.error('ERROR - Unable to connect to the database:', err) })
// Main logix Promise.fromNode(cb => { api.listen(config.LANDO_METRICS_PORT, cb); }) .then(() => { log.info('Listening on port: %s', config.LANDO_METRICS_PORT); });
request({ method:"GET", url:req.clientParam.url }).then(function (response) { return response.body; })