Skip to content

Instantly share code, notes, and snippets.

View yoelmacia's full-sized avatar

Yoel Macia Delgado yoelmacia

View GitHub Profile
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);
const express = require("express");
const app = express();
const port = process.env.PORT || 3000;
app.get("/", (req, res) => {
res.sendFile("index.html", { root: __dirname });
});
app.listen(port, () => console.log(`Example app listening on port ${port}!`));
<!DOCTYPE html>
<html>
<head>
<title>Authorize App</title>
</head>
<body>
<a href="https://github.com/login/oauth/authorize?&client_id=<your_client_id>">Authorize</a>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Render index html file</title>
</head>
<body>
<a
href="https://github.com/login/oauth/authorize?&client_id=ae6ef264bcaf6013aa70"
>Click here</a
>
const express = require("express");
const app = express();
const port = process.env.PORT || 3000;
app.listen(port, () => console.log(`Example app listening on port ${port}!`));
const express = require("express");
const app = express();
const port = process.env.PORT || 3000;
app.get("/", (req, res) => {
res.send("Hello World");
});
app.listen(port, () => console.log(`Example app listening on port ${port}!`));