Odstranit server.js
This commit is contained in:
27
server.js
27
server.js
@@ -1,27 +0,0 @@
|
|||||||
const express = require('express');
|
|
||||||
const cors = require('cors');
|
|
||||||
const app = express();
|
|
||||||
const PORT = 8080;
|
|
||||||
|
|
||||||
// Povolení CORS pro všechny požadavky (včetně rozšíření)
|
|
||||||
app.use(cors());
|
|
||||||
app.use(express.json());
|
|
||||||
|
|
||||||
app.post('/endpoint', (req, res) => {
|
|
||||||
console.log("--- New Song Received ---");
|
|
||||||
console.log("Přijatá data:", req.body);
|
|
||||||
|
|
||||||
if (req.body && req.body.artist) {
|
|
||||||
console.log(`Interpret: ${req.body.artist}`);
|
|
||||||
console.log(`Skladba: ${req.body.title}`);
|
|
||||||
console.log(`Čas: ${req.body.timestamp}`);
|
|
||||||
} else {
|
|
||||||
console.log("Poznámka: Tělo požadavku je prázdné nebo špatně formátované.");
|
|
||||||
}
|
|
||||||
|
|
||||||
res.sendStatus(200);
|
|
||||||
});
|
|
||||||
|
|
||||||
app.listen(PORT, '0.0.0.0', () => {
|
|
||||||
console.log(`Server běží a poslouchá na portu ${PORT}...`);
|
|
||||||
});
|
|
||||||
Reference in New Issue
Block a user