testing in prod time

This commit is contained in:
oat 2020-10-12 05:07:58 +03:00
parent e218255441
commit df6c1545af
Signed by: oat
GPG key ID: DD83A9617A252385

View file

@ -6,6 +6,8 @@ const API_ENDPOINT = 'https://discord.com/api/v6';
const axios = require('axios').default;
export function run(app) {
const logger = app.get('logger');
app.get('/discordauth', async (req, res) => {
const code = req.query.code;
@ -57,6 +59,8 @@ export function run(app) {
res.send(`hi ${userInfo.data.username}#${userInfo.data.discriminator}<br><img src="https://media.discordapp.net/avatars/${userInfo.data.id}/${userInfo.data.avatar}.png"><br>ur useruuid is ${userUuid}`);
} catch(err) {
res.send(`whoooops<br>${err}`);
console.error(err);
logger.error(err);
}
} else {
const url = `http://${req.headers.host}/discordauth`;