18 lines
452 B
JavaScript
18 lines
452 B
JavaScript
|
const express = require('express');
|
||
|
const path = require('path');
|
||
|
const app = express();
|
||
|
const PORT = process.env.PORT || 3000;
|
||
|
|
||
|
// Statische Dateien bereitstellen (Root-Verzeichnis)
|
||
|
app.use(express.static(__dirname));
|
||
|
|
||
|
// Route für die Startseite
|
||
|
app.get('/', (req, res) => {
|
||
|
res.sendFile(path.join(__dirname, 'index.html'));
|
||
|
});
|
||
|
|
||
|
// Starten des Servers
|
||
|
app.listen(PORT, () => {
|
||
|
console.log(`Server läuft auf http://localhost:${PORT}`);
|
||
|
});
|