mirror of
https://github.com/Akif9748/akf-forum.git
synced 2024-11-26 05:10:41 +03:00
Added host to config.json
This commit is contained in:
parent
e4a93cbf52
commit
b048d6a685
2 changed files with 4 additions and 4 deletions
|
@ -13,5 +13,6 @@
|
||||||
"max": 25,
|
"max": 25,
|
||||||
"windowMs": 60000
|
"windowMs": 60000
|
||||||
},
|
},
|
||||||
"discord_auth": false
|
"discord_auth": false,
|
||||||
|
"host": "akf-forum.glitch.me"
|
||||||
}
|
}
|
5
index.js
5
index.js
|
@ -4,7 +4,7 @@ const { urlencoded: BP } = require('body-parser'),
|
||||||
SES = require('express-session');
|
SES = require('express-session');
|
||||||
|
|
||||||
const
|
const
|
||||||
{ def_theme, forum_name, description, limits, global_ratelimit: RLS, discord_auth } = require("./config.json"),
|
{ def_theme, forum_name, description, limits, global_ratelimit: RLS, discord_auth, host } = require("./config.json"),
|
||||||
{ UserModel, BanModel } = require("./models"),
|
{ UserModel, BanModel } = require("./models"),
|
||||||
port = process.env.PORT || 3000,
|
port = process.env.PORT || 3000,
|
||||||
mongoose = require("mongoose"),
|
mongoose = require("mongoose"),
|
||||||
|
@ -54,6 +54,5 @@ const server = app.listen(port, () => console.log(`${forum_name}-forum on port:`
|
||||||
|
|
||||||
if (discord_auth) {
|
if (discord_auth) {
|
||||||
const { address } = server.address();
|
const { address } = server.address();
|
||||||
console.log(`https://discord.com/api/oauth2/authorize?client_id=${process.env.DISCORD_CLIENT}&redirect_uri=http%3A%2F%2F${address == '::' ? 'localhost:' + port : address}%2Fdiscord_auth%2Fhash&response_type=token&scope=identify`)
|
app.set("discord_auth", `https://discord.com/api/oauth2/authorize?client_id=${process.env.DISCORD_CLIENT}&redirect_uri=http%3A%2F%2F${host}%2Fdiscord_auth%2Fhash&response_type=token&scope=identify`);
|
||||||
app.set("discord_auth", `https://discord.com/api/oauth2/authorize?client_id=${process.env.DISCORD_CLIENT}&redirect_uri=http%3A%2F%2F${address == '::' ? 'localhost:' + port : address}%2Fdiscord_auth%2Fhash&response_type=token&scope=identify`);
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue