-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
105 lines (88 loc) · 2.58 KB
/
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
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
const express = require("express");
const path = require("path");
require('dotenv').config();
const app = express();
const PORT = process.env.PORT || 3000;
// Set EJS as the view engine
app.set("view engine", "ejs");
app.set("views", path.join(__dirname, "views")); // Set the directory for EJS templates
// Serve static files from the "assets" and "vendor" directories
app.use("/assets", express.static(path.join(__dirname, "assets")));
app.use("/vendor", express.static(path.join(__dirname, "vendor")));
// Serve HTML files for specific routes
app.get("/", (req, res) => {
res.render("crypto-systems", {
title: "Home Page",
message: "Welcome to my EJS site!",
});
});
app.get("/algorithms", (req, res) => {
res.render("crypto-algorithms", {
title: "Home Page",
message: "Welcome to my EJS site!",
});
});
app.get("/signatures", (req, res) => {
res.render("crypto-signatures", {
title: "Home Page",
message: "Welcome to my EJS site!",
});
});
app.get("/details", (req, res) => {
res.render("details", {
title: "Home Page",
message: "Welcome to my EJS site!",
});
});
app.get("/profile", (req, res) => {
res.render("profile", {
title: "Home Page",
message: "Welcome to my EJS site!",
});
});
app.get("/streams", (req, res) => {
res.render("streams", {
title: "Home Page",
message: "Welcome to my EJS site!",
});
});
app.get("/crypto-systems/rsa", (req, res) => {
res.render("crypto-systems/rsa", {
title: "Home Page",
message: "Welcome to my EJS site!",
});
});
app.get("/crypto-systems/elgamal", (req, res) => {
res.render("crypto-systems/elgamal", {
title: "Home Page",
message: "Welcome to my EJS site!",
});
});
app.get("/crypto-systems/ecc", (req, res) => {
res.render("crypto-systems/ecc", {
title: "Home Page",
message: "Welcome to my EJS site!",
});
});
app.get("/crypto-signatures/rsa", (req, res) => {
res.render("crypto-signatures/rsa", {
title: "Home Page",
message: "Welcome to my EJS site!",
});
});
app.get("/crypto-signatures/elgamal", (req, res) => {
res.render("crypto-signatures/elgamal", {
title: "Home Page",
message: "Welcome to my EJS site!",
});
});
app.get("/crypto-signatures/ecc", (req, res) => {
res.render("crypto-signatures/ecc", {
title: "Home Page",
message: "Welcome to my EJS site!",
});
});
// Start the server
app.listen(PORT, () => {
console.log(`Server running on http://localhost:${PORT}`);
});