Created
December 21, 2017 16:43
-
-
Save Dakuan/7800b1b5b9755674a3ca5b7029e6cb90 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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