Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
app.post('/example', (req, res) => {
console.log(`Hit example with ${JSON.stringify(req.body)}`);
return res.sendStatus(200);
});
function getRedisConfig(redisUrl) {
const redisConfig = url.parse(redisUrl);
return {
host: redisConfig.hostname || 'localhost',
port: Number(redisConfig.port || 6379),
database: (redisConfig.pathname || '/0').substr(1) || '0',
password: redisConfig.auth ? redisConfig.auth.split(':')[1] : undefined
};
}
app.use('/', Arena(
{
queues: [
{
name: NOTIFY_URL,
hostId: 'Worker',
redis: getRedisConfig(process.env.REDIS_URL)
}
]
},
{
basePath: '/arena',
disableListen: true
}
));
const PORT = process.env.PORT || 3000;
extra: { additional: 'data', is: 'awesome' },
});
}
try {
Throw();
} catch (err) {
logger.error({ err });
}
logger.error('0');
logger.error('1');
res.status(200).send('{}');
};
exports.bullArena = Arena({
queues: [
{
hostId: 'local',
name: 'rss',
url: config.cache.uri,
},
{
hostId: 'local',
name: 'podcast',
url: config.cache.uri,
},
{
hostId: 'local',
name: 'og',
url: config.cache.uri,
},