-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebsite.js
49 lines (35 loc) · 1.16 KB
/
website.js
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
function website() {
const next = require('next');
const dev = process.env.NODE_ENV !== 'production';
const nextApp = next({ dev });
nextApp.prepare().then(() => {
const express = require('express');
const app = express();
app.use('*' , (req, res) => {
res.send("test")
})
// Discord OAuth2 route
app.get('/auth/discord', (req, res) => {
// Handle Discord OAuth2
});
// Route to get servers
app.get('/servers', (req, res) => {
// Get the list of servers the user has access to
});
// Route to enable slash commands
app.post('/commands/enable', (req, res) => {
// Enable slash commands
});
// Route to disable slash commands
app.post('/commands/disable', (req, res) => {
// Disable slash commands
});
// Let Next.js handle all other routes
app.all('*', (req, res) => {
const handle = nextApp.getRequestHandler();
return handle(req, res);
});
app.listen(3000, () => console.log('Server running on port 3000'));
});
}
module.exports = website