generic yt downloaded video posted when request is sent

This commit is contained in:
Alexander Harding 2025-01-14 14:13:55 -05:00
parent bc0cbff9a3
commit 72ed9fe4dd
3 changed files with 5 additions and 4 deletions

View File

@ -1,9 +1,9 @@
{ {
"name": "filedistroserver", "name": "filedistroserver",
"version": "1.0.0", "version": "1.0.0",
"main": "index.js", "main": "src/index.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "server": "node ."
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",

BIN
src/assets/video.mp4 Normal file

Binary file not shown.

View File

@ -1,10 +1,11 @@
const express = require("express"); const express = require("express");
const { join } = require("path");
const app = express(); const app = express();
const port = process.env.PORT || 3000; const port = process.env.PORT || 3001;
app.get('/', (req, res) => { app.get('/', (req, res) => {
res.send("<h1>Hello World</h1>") res.setHeader("Content-Type", "video/mp4").sendFile(join(__dirname, "assets", "video.mp4"));
}); });
app.listen(port, () => { app.listen(port, () => {