Created
December 4, 2019 12:29
-
-
Save yoelmacia/db068ac533bbeb967988d2d0e110c61a 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(); | |
const port = process.env.PORT || 3000; | |
app.get("/", (req, res) => { | |
res.sendFile("index.html", { root: __dirname }); | |
}); | |
app.get("/user/signin/callback", (req, res) => { | |
const { query } = req; | |
const { code } = query; | |
if (!code) { | |
return res.send({ | |
success: "false", | |
message: "Error, no code" | |
}); | |
} | |
res.send(code); | |
}); | |
app.listen(port, () => console.log(`Example app listening on port ${port}!`)); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment