-
Notifications
You must be signed in to change notification settings - Fork 1
/
server.js
54 lines (48 loc) · 1.5 KB
/
server.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
50
51
52
53
54
const express = require('express');
const path = require('path');
const app = express();
const port = process.env.PORT || 8080;
// sendFile will go here
/* app.get('/', function(req, res) {
res.sendFile(path.join(__dirname, '/public/index.html'));
});*/
app.get('/', function(req, res) {
res.sendFile(path.join(__dirname, '/database.json'));
});
/*
app.get('/.replit', function(req, res) {
res.sendFile(path.join(__dirname, '/public/mimic1.txt'));
});
app.get('/bot.js', function(req, res) {
res.sendFile(path.join(__dirname, '/bot.js'));
});
app.get('/bot2.js', function(req, res) {
res.sendFile(path.join(__dirname, '/bot2.js'));
});
app.get('/package.json', function(req, res) {
res.sendFile(path.join(__dirname, '/package.json'));
});
app.get('/style.css', function(req, res) {
res.sendFile(path.join(__dirname, '/public/style.css'));
})
app.get('/updates', function(req, res) {
res.sendFile(path.join(__dirname, '/public/updates.html'));
})
app.get('/files', function(req, res){
res.sendFile(path.join(__dirname, '/public/files.html'));
})
app.get('/server.js', function(req, res) {
res.sendFile(path.join(__dirname, '/server.js'));
})
app.get('/alpha', function(req, res) {
res.sendFile(path.join(__dirname, '/public/alphabet.json'));
});
*/
//The 404 Route (ALWAYS Keep this as the last route)
app.get('*', function(req, res){
res.sendFile(path.join(__dirname, '/public/404.html'));
});
function keepAlive(){
app.listen(port, ()=>{console.log("Server is Ready!")});
}
module.exports = keepAlive;