Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// terminate the Node.js process with a non-zero exit code.
process.on('unhandledRejection', err => {
throw err
})
db.init({
user: process.env.DB_USER,
host: process.env.DB_HOST,
password: process.env.DB_PASSWORD,
database: 'unwelch',
port: process.env.DB_PORT
})
const app = express()
if (process.env.NODE_ENV === 'production') {
app.use(sentryHandlers.requestHandler()) // The request handler must be the first middleware on the app
}
app.use(bodyParser.json())
app.use(cors())
app.use(passport.initialize())
passport.serializeUser((user, done) => {
done(null, user)
})
passport.deserializeUser((user, done) => {
done(null, user)
})
passport.use(googleStrategy)
app.get('/auth/google', googleAuthMiddleware)