Skip to content

Instantly share code, notes, and snippets.

@Dakuan
Created December 21, 2017 16:43
Show Gist options
  • Save Dakuan/7800b1b5b9755674a3ca5b7029e6cb90 to your computer and use it in GitHub Desktop.
Save Dakuan/7800b1b5b9755674a3ca5b7029e6cb90 to your computer and use it in GitHub Desktop.
const express = require("express")
const app = express()
app.use((req, res) => {
if (req.get('authorization') === process.env.TOKEN) {
res.json({
ok: true
})
} else {
res.status(401).json({
ok: false
})
}
})
const port = process.env.PORT || 8080
app.listen(port, () => {
console.log(`auth_svc listening on ${port}`)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment