-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
45 lines (42 loc) · 1.25 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
// Express
const express = require("express");
// Fetch data module
const data = require("./fetch-data");
// The app
const app = express()
// Port
const port = 8080
// Set views directory
app.set('views', './views')
// Set view engine
app.set('view engine', 'pug')
// Set static file directory
app.use(express.static('public'))
// Handle home requests
app.get("/", (req, res) => {
// Render
res.render("home",
{plugin_downloads: data.getPluginDownloads(),
projects: data.getProjects(),
average_stars: data.getAverageStars(),
repairitem: {
download: data.getDownloadURL(55890),
page: data.getPageURL(55890),
docs: "https://davidcubesvk.com/wiki/plugin/RepairItem/"
},
clickspersecond: {
download: data.getDownloadURL(57214),
page: data.getPageURL(57214),
docs: "https://davidcubesvk.com/wiki/plugin/ClicksPerSecond/"
},
securednetwork: {
download: data.getDownloadURL(65075),
page: data.getPageURL(65075),
docs: "https://davidcubesvk.com/wiki/plugin/SecuredNetwork/"
}
})
})
// Create the server
app.listen(port, () => {
console.log(`Listening on http://localhost:${port}`)
})