Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
if (version === '0') {
const newToken = upgradeToken(token)
res.status(400)
res.send({ error: 'old-version', newToken })
return
}
res.status(400)
res.send({ error: 'invalid-token' })
})
if (process.env.NODE_ENV === 'production') {
// The error handler must be before any other error middleware
app.use(sentryHandlers.errorHandler())
}
app.get('/_health', (_, res) => {
res.json({ ok: true })
})
console.log('Starting server...')
app.listen(3000)