fix test function IV

This commit is contained in:
2021-07-31 15:57:22 +02:00
parent d0c8659b6b
commit 6860952284
2 changed files with 12 additions and 18 deletions

3
.gitignore vendored
View File

@@ -6,3 +6,6 @@ node_modules
dist
.env
.env.*
# Local Netlify folder
.netlify

View File

@@ -1,22 +1,13 @@
const axios = require('axios');
exports.handler = async function(event, context) {
axios
.get(`https://discord.com/api/v9/users/@me`, {
headers: {
Authorization: `Bot ${process.env.token}`,
},
})
.then((response) => {
return {
statusCode: 200,
body: JSON.stringify(response.data),
};
})
.catch((error) => {
return {
statusCode: 500,
body: JSON.stringify({ errorMsg: 'discord api shat itself brb' }),
};
});
let response = await axios.get(`https://discord.com/api/v9/users/@me`, {
headers: {
Authorization: `Bot ${process.env.token}`,
},
});
return {
statusCode: 200,
body: JSON.stringify(response.data),
};
};