Skip to content

Commit

Permalink
la til /me
Browse files Browse the repository at this point in the history
  • Loading branch information
eilifjohansen committed Dec 13, 2024
1 parent 2bf636d commit 9ac703e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@ let app = express();

app.use(cors())

app.get('/me', (req, res) => {
const apiUrl = "https://graph.microsoft.com/v1.0/me/";
const options = {
headers: { Authorization: `Bearer ${process.env.MS_GRAPH_TOKEN}` },
};

axios.get(apiUrl, options)
.then(response => {
res.json(response.data);
})
.catch(error => {
console.error(error);
res.status(500).send("Error occurred while fetching data from Microsoft Graph API: " + error);
});
});

app.get('/siteimprov*', (req, res) => {
let apiUrl = "https://api.siteimprove.com/v2";
req.url = req.url.replace(/\/siteimprove/, '')
Expand Down

0 comments on commit 9ac703e

Please sign in to comment.