Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const result = await client.query('SELECT $1::text as message', [
'Hello world!',
]);
console.log(result.rows[0].message);
res.send('Hello World!');
});
app.get('/hello/:name', function hello(req, res) {
throw new Error('hello from Express');
res.send(`Hello ${req.params.name}`);
});
// Error handler middleware should be the last one.
// See http://expressjs.com/en/guide/error-handling.html
app.use(airbrakeExpress.makeErrorHandler(airbrake));
app.listen(3000, function() {
console.log('Example app listening on port 3000!');
});
}