forked from Simpleboy353/Infinity-Website
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
64 lines (51 loc) · 1.52 KB
/
Copy pathindex.js
File metadata and controls
64 lines (51 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
const express = require('express');
const app = express();
const port = 3003;
app.set('view engine', 'ejs');
app.use(express.static('public'));
app.get('/', (req, res) => {
res.status(200).render('index');
});
app.get('/commands', (req, res) => {
res.status(200).render('commands');
});
app.get('/changelogs', (req, res) => {
res.status(200).render('changelogs');
});
app.get('/info', (req, res) => {
res.status(200).render('info');
});
app.get('/policies', (req, res) => {
res.status(200).render('policies');
});
app.get('/custom', (req, res) => {
res.status(200).render('custom');
});
app.get('/thanks', (req, res) => {
if (req.query.error === undefined && req.query.code === undefined)
return res.status(200).render('thanks');
if (req.query.error) {
return res.status(200).redirect('https://bots.shadowdevs.com');
} else {
res.status(200).redirect('https://bots.shadowdevs.com/thanks');
}
});
app.get('/code', (req, res) => {
res.status(200).redirect('https://github.com/Shadow-Develops/shadow-bot');
});
app.get('/invite', (req, res) => {
res
.status(200)
.redirect(
'https://discord.com/oauth2/authorize?client_id=740023863479631943&permissions=1513938742527&scope=bot&response_type=code&redirect_uri=https://bots.shadowdevs.com/thanks'
);
});
app.get('/support', (req, res) => {
res.status(200).redirect('https://discord.gg/fVrRa8z');
});
app.get('*', (req, res) => {
res.status(404).render('404');
});
app.listen(port, () => {
console.log(`SD Bots website is active and listening to port ${port}`);
});