Filip Borum Poulsen 2 years ago
parent 688e1e31cd
commit f04358a71c

@ -91,7 +91,7 @@ function startVideo(path) {
}); });
} }
// fs.mkdirSync('/video', { recursive: true }); fs.mkdirSync('/video', { recursive: true });
app.post('/play', (req, res) => { app.post('/play', (req, res) => {
if (process) { if (process) {
@ -125,7 +125,7 @@ app.post('/upload', function (req, res) {
// The name of the input field (i.e. "sampleFile") is used to retrieve the uploaded file // The name of the input field (i.e. "sampleFile") is used to retrieve the uploaded file
const uploadPath = path.join(__dirname, '/public/videos/'); const uploadPath = path.join(__dirname, '/public/videos/');
req.files.file.mv(uploadPath + req.files.file.name, function (err) { req.files.file.mv(uploadPath + "video.mp4", function (err) {
if (err) { if (err) {
return res.status(500); return res.status(500);
} }

@ -2,17 +2,13 @@
Description=Video Player Description=Video Player
After=multi-user.target After=multi-user.target
StartLimitIntervalSec=500
StartLimitBurst=50
[Service] [Service]
WorkingDirectory=/home/steady/video-player WorkingDirectory=/home/steady/video-player
ExecStart=node /home/steady/video-player/index.js ExecStart=node /home/steady/video-player/index.js
Environment=DISPLAY=:0 Environment=DISPLAY=:0
User=1000 User=1000
Group=1000 Group=1000
Restart=on-failure Restart=always
RestartSec=5s
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target
Loading…
Cancel
Save