forked from Krxuv/api-krxuv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
107 lines (102 loc) · 3.37 KB
/
index.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
__path = process.cwd();
var favicon = require('serve-favicon');
var express = require('express'),
cors = require('cors'),
path = require('path'),
secure = require('ssl-express-www');
//const PORT = process.env.PORT || 8080 || 5000 || 3000
const PORT = process.env.PORT || 8000 || 5000 || 3000
var { color } = require('./lib/color.js')
var apirouter = require('./routes/api')
var app = express()
app.enable('trust proxy');
app.set("json spaces",2)
app.use(cors())
app.use(secure)
app.use(favicon(__path +'/views/favicon.ico'))
app.use(express.static(path.join(__dirname, 'dist')));
app.use('/api', apirouter);
app.get("/", (req, res) => {
res.sendFile(path.join(__dirname, 'dist', 'index.html'))
})
app.get("/docs", (req, res) => {
res.sendFile(path.join(__dirname, 'dist', 'index.html'))
})
app.get("/anime", (req, res) => {
res.sendFile(path.join(__dirname, 'dist', 'index.html'))
})
app.get("/antaranews", (req, res) => {
res.sendFile(path.join(__dirname, 'dist', 'index.html'))
})
app.get("/canvas", (req, res) => {
res.sendFile(path.join(__dirname, 'dist', 'index.html'))
})
app.get("/cecan", (req, res) => {
res.sendFile(path.join(__dirname, 'dist', 'index.html'))
})
app.get("/cnbcnews", (req, res) => {
res.sendFile(path.join(__dirname, 'dist', 'index.html'))
})
app.get("/cnnnews", (req, res) => {
res.sendFile(path.join(__dirname, 'dist', 'index.html'))
})
app.get("/downloader", (req, res) => {
res.sendFile(path.join(__dirname, 'dist', 'index.html'))
})
app.get("/encdec", (req, res) => {
res.sendFile(path.join(__dirname, 'dist', 'index.html'))
})
app.get("/games", (req, res) => {
res.sendFile(path.join(__dirname, 'dist', 'index.html'))
})
app.get("/islam", (req, res) => {
res.sendFile(path.join(__dirname, 'dist', 'index.html'))
})
app.get("/merdekanews", (req, res) => {
res.sendFile(path.join(__dirname, 'dist', 'index.html'))
})
app.get("/okezonenews", (req, res) => {
res.sendFile(path.join(__dirname, 'dist', 'index.html'))
})
app.get("/photooxy", (req, res) => {
res.sendFile(path.join(__dirname, 'dist', 'index.html'))
})
app.get("/randomimage", (req, res) => {
res.sendFile(path.join(__dirname, 'dist', 'index.html'))
})
app.get("/republikanews", (req, res) => {
res.sendFile(path.join(__dirname, 'dist', 'index.html'))
})
app.get("/search", (req, res) => {
res.sendFile(path.join(__dirname, 'dist', 'index.html'))
})
app.get("/sindonews", (req, res) => {
res.sendFile(path.join(__dirname, 'dist', 'index.html'))
})
app.get("/suaranews", (req, res) => {
res.sendFile(path.join(__dirname, 'dist', 'index.html'))
})
app.get("/temponews", (req, res) => {
res.sendFile(path.join(__dirname, 'dist', 'index.html'))
})
app.get("/textpro", (req, res) => {
res.sendFile(path.join(__dirname, 'dist', 'index.html'))
})
app.get("/tools", (req, res) => {
res.sendFile(path.join(__dirname, 'dist', 'index.html'))
})
app.get("/tribunnews", (req, res) => {
res.sendFile(path.join(__dirname, 'dist', 'index.html'))
})
app.get("/wallpaper", (req, res) => {
res.sendFile(path.join(__dirname, 'dist', 'index.html'))
})
app.all('*', (req, res) => {
return res
.status(404)
.send({ creator: 'kimimaru', message: 'Not found', success: false });
});
app.listen(PORT, () => {
console.log(color("Server running on port " + PORT,'green'))
})
module.exports = app