-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
34 lines (29 loc) · 864 Bytes
/
app.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
const express = require("express");
const bodyParser = require("body-parser");
const app = express();
const port = process.env.PORT || 3000;
app.use(bodyParser.urlencoded({ extended: true }));
app.use(express.static(__dirname + "/public"));
app.use(express.static(__dirname + "/views"));
app.set("view engine", "ejs");
const socials = [
["Discord", "5764F1"],
["Facebook", "0178E9"],
["Instagram", "E33467"],
["Linkedin", "0288D1"],
["Reddit", "ff4500"],
["Snapchat", "FFFC00"],
["Telegram", "249BD7"],
["Twitter", "29A8DF"],
["Whatsapp", "1BD741"],
["Youtube", "FF0000"],
];
const d = new Date();
const currentYear = d.getFullYear();
app.get("/", (req, res) => {
res.render("index", { socials: socials, currentYear: currentYear });
});
app.listen(port, () => {
console.log("Server started on port " + port);
});
module.exports = app;