export function connect() { return new Promise((resolve, reject) => { r.on('ready', () => { console.log(chalk.greenBright(`-------\nRedis-> connected on ${config['redis-jwt'].host}:${config['redis-jwt'].port}/${config['redis-jwt'].db}\n-------`)); resolve(); }); r.on('error', (err) => { console.log(chalk.redBright(err)); }); }); }
/* GET home page. */ router.get('/', function(req, res, next) { var requestUrl = req.protocol + '://' + req['headers'].host + req.originalUrl; if(!cache.token){ getToken(res,requestUrl); }else{ getTiket(res,requestUrl); } });
mongoose.connection.on('error', () => { throw new Error(`unable to connect to database: ${mongo.host}`); });
async init(modelPaths, logger) { const db = new Sequelize(dbConfig.name, dbConfig.user, dbConfig.password, { dialect: dbConfig.dialect, host: dbConfig.host, port: dbConfig.port, logging: env !== 'test' ? logger.info.bind(logger) : false, benchmark: true, retry: { max: 3, typeValidation: true }, native: true, operatorsAliases }) await each(modelPaths, (modelPath) => db.import(modelPath)) if (dbConfig.sync) await db.sync() return db }
title={item[fields.title] || 'Untitled'} url={item[fields.url]} host={item[fields.host]} date={item[fields.publication_date]} score={item.score}
} else { dom.server.removeAttribute('href'); dom.server.innerText = (new URL(server.serverURL)).host;
host.host += ':' + port.toString();
expect(server.connection.mock.calls[0][0].host).toBe(options.connections[0].host); }); expect(server.connection.mock.calls[0][0].host).toBe(undefined); }); process.env.HOST = 'honeycomb.example.com'; honeycombServer.start(); expect(server.connection.mock.calls[0][0].host).toBe('honeycomb.example.com'); }); });
export function connect() { return new Promise((resolve, reject) => { r.on('ready', () => { console.log(chalk.greenBright(`-------\nRedis-> connected on ${config['redis-jwt'].host}:${config['redis-jwt'].port}/${config['redis-jwt'].db}\n-------`)); resolve(); }); r.on('error', (err) => { console.log(chalk.redBright(err)); }); }); }
async init(modelPaths, logger) { const db = new Sequelize(dbConfig.name, dbConfig.user, dbConfig.password, { dialect: dbConfig.dialect, host: dbConfig.host, port: dbConfig.port, logging: env !== 'test' ? logger.info.bind(logger) : false, benchmark: true, retry: { max: 3, typeValidation: true }, native: true, operatorsAliases }) await each(modelPaths, (modelPath) => db.import(modelPath)) if (dbConfig.sync) await db.sync() return db }
async init(modelPaths, logger) { const db = new Sequelize(dbConfig.name, dbConfig.user, dbConfig.password, { dialect: dbConfig.dialect, host: dbConfig.host, port: dbConfig.port, logging: env !== 'test' ? logger.info.bind(logger) : false, benchmark: true, retry: { max: 3, typeValidation: true }, native: true, operatorsAliases }) await each(modelPaths, (modelPath) => db.import(modelPath)) if (dbConfig.sync) await db.sync() return db }
async init(modelPaths, logger) { const db = new Sequelize(dbConfig.name, dbConfig.user, dbConfig.password, { dialect: dbConfig.dialect, host: dbConfig.host, port: dbConfig.port, logging: env !== 'test' ? logger.info.bind(logger) : false, benchmark: true, retry: { max: 3, typeValidation: true }, native: true, operatorsAliases }) await each(modelPaths, (modelPath) => db.import(modelPath)) if (dbConfig.sync) await db.sync() return db }
async init(modelPaths, logger) { const db = new Sequelize(dbConfig.name, dbConfig.user, dbConfig.password, { dialect: dbConfig.dialect, host: dbConfig.host, port: dbConfig.port, logging: env !== 'test' ? logger.info.bind(logger) : false, benchmark: true, retry: { max: 3, typeValidation: true }, native: true, operatorsAliases }) await each(modelPaths, (modelPath) => db.import(modelPath)) if (dbConfig.sync) await db.sync() return db }
async init(modelPaths, logger) { const db = new Sequelize(dbConfig.name, dbConfig.user, dbConfig.password, { dialect: dbConfig.dialect, host: dbConfig.host, port: dbConfig.port, logging: env !== 'test' ? logger.info.bind(logger) : false, benchmark: true, retry: { max: 3, typeValidation: true }, native: true, operatorsAliases }) await each(modelPaths, (modelPath) => db.import(modelPath)) if (dbConfig.sync) await db.sync() return db }
expect(server.connection.mock.calls[0][0].host).toBe(options.connections[0].host); }); expect(server.connection.mock.calls[0][0].host).toBe(undefined); }); process.env.HOST = 'honeycomb.example.com'; honeycombServer.start(); expect(server.connection.mock.calls[0][0].host).toBe('honeycomb.example.com'); }); });