mirror of
https://github.com/filecoffee/filehost.git
synced 2024-11-13 19:49:56 +01:00
28 lines
744 B
JavaScript
28 lines
744 B
JavaScript
require("dotenv").config();
|
|
const express = require("express");
|
|
const ejs = require("ejs");
|
|
const fileRoutes = require("./routes/file.routes");
|
|
|
|
const app = express();
|
|
const port = process.env.PORT || 3000;
|
|
const apiKeys = process.env.API_KEYS.split(",");
|
|
const allowPublicUploads = process.env.ALLOW_PUBLIC_UPLOADS === "true";
|
|
const hosterEmail = process.env.HOSTER_EMAIL;
|
|
|
|
let totalUploads = 0;
|
|
let totalSize = 0;
|
|
|
|
app.set("view engine", "ejs");
|
|
app.use(fileRoutes);
|
|
|
|
app.get("/", (req, res) => {
|
|
res.render("index", {
|
|
totalUploads: totalUploads,
|
|
totalSize: totalSize.toFixed(2), // Format to 2 decimal places
|
|
hosterEmail: hosterEmail,
|
|
});
|
|
});
|
|
|
|
app.listen(port, () => {
|
|
console.log(`Server is running on port ${port}`);
|
|
});
|