const express = require("express"); const multer = require("multer"); const path = require("path"); const os = require("os"); const crypto = require("crypto"); const app = express(); const port = 7860; app.use("/file", express.static(os.tmpdir())); //app.use("/", express.static(path.join(process.cwd(), 'index.html'))); const storage = multer.diskStorage({ destination: (req, file, cb) => cb(null, os.tmpdir()), filename: (req, file, cb) => { const randomName = crypto.randomBytes(4).toString("base64url"); cb(null, `${randomName}${path.extname(file.originalname)}`); }, }); const upload = multer( { storage, limits: { fileSize: 10 * 1024 * 1024 } }); app.all('/', async (req, res) => { res.send(`
Fast & simple.