-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.js
53 lines (41 loc) · 1.36 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
const express = require("express");
const path = require("path");
const axios = require("axios");
const moment = require("moment");
var bodyParser = require("body-parser");
var { Parser } = require("json2csv");
const { enable } = require("express/lib/application");
const { log } = require("console");
var urlencodedParser = bodyParser.urlencoded({ extended: false });
const app = express();
app.set("view engine", "html");
app.engine("html", require("ejs").renderFile);
app.use(express.static(path.join(__dirname, "public")));
const port = 5000;
app.get("/", (req, res) => {
res.render(__dirname + "/index", { title: "", server: "", username: "" });
});
app.get("/login", (req, res) => {
res.render(__dirname + "/index2", { title: "", server: "", username: "" });
});
app.get("/tools", (req, res) => {
res.render(__dirname + "/tools");
});
app.get("/departments", (req, res) => {
res.render(__dirname + "/departments");
});
app.get("/users", (req, res) => {
res.render(__dirname + "/users");
});
app.get("/livechat-rooms", (req, res) => {
res.render(__dirname + "/livechat-rooms");
});
app.get("/channels", (req, res) => {
res.render(__dirname + "/channels");
});
app.listen(port, () => {
console.log(`Example app listening at http://localhost:${port}`);
console.log(
"Go to browser and type: http://localhost:5000/export and see the magic happen :)"
);
});