-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
37 lines (30 loc) · 931 Bytes
/
Copy pathindex.js
File metadata and controls
37 lines (30 loc) · 931 Bytes
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
const express = require("express");
const path = require("path");
const app = express();
require("dotenv").config();
const port = process.env.PORT || 3000;
app.get("/static/:dir/:file", function (req, res) {
res.sendFile(
path.join(__dirname, "static", `${req.params.dir}/${req.params.file}`)
);
});
app.get("/favicon/:file", function (req, res) {
res.sendFile(
path.join(__dirname, "favicon", `${req.params.file}`)
);
});
app.get("/google37c8f4fdd8152020.html", function (req, res) {
res.sendFile("google37c8f4fdd8152020.html", { root: __dirname });
});
app.get("/sitemap.xml", function (req, res) {
res.sendFile("sitemap.xml", { root: __dirname });
});
app.get("/*", function (req, res) {
res.sendFile("index.html", { root: __dirname });
});
// app.get("/test", function (req, res) {
// res.send("Working")
// });
app.listen(port, () => {
console.log(`FETN in running on port ${port}`);
});