aufgeteilt in Module
This commit is contained in:
30
db/mongo.js
Normal file
30
db/mongo.js
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import { MongoClient } from 'mongodb';
|
||||||
|
|
||||||
|
const MONGO_ROOT_USER = process.env.MONGO_ROOT_USER;
|
||||||
|
const MONGO_ROOT_PASSWORD = process.env.MONGO_ROOT_PASSWORD;
|
||||||
|
let MONGO_URI = process.env.MONGO_URI || 'mongodb://localhost:27017';
|
||||||
|
|
||||||
|
if (MONGO_ROOT_USER && MONGO_ROOT_PASSWORD) {
|
||||||
|
const uriParts = MONGO_URI.split('://');
|
||||||
|
if (uriParts.length === 2) {
|
||||||
|
const protocol = uriParts[0];
|
||||||
|
const rest = uriParts[1];
|
||||||
|
MONGO_URI = `${protocol}://${encodeURIComponent(MONGO_ROOT_USER)}:${encodeURIComponent(MONGO_ROOT_PASSWORD)}@${rest}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const DB_NAME = process.env.DB_NAME || 'espdb';
|
||||||
|
|
||||||
|
let db, entriesCollection, usersCollection;
|
||||||
|
|
||||||
|
export async function initMongo() {
|
||||||
|
const client = new MongoClient(MONGO_URI);
|
||||||
|
await client.connect();
|
||||||
|
db = client.db(DB_NAME);
|
||||||
|
entriesCollection = db.collection('entries');
|
||||||
|
usersCollection = db.collection('users');
|
||||||
|
return { db, entriesCollection, usersCollection };
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getCollections() {
|
||||||
|
return { db, entriesCollection, usersCollection };
|
||||||
|
}
|
||||||
33
routes/address.js
Normal file
33
routes/address.js
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
import { getCollections } from '../db/mongo.js';
|
||||||
|
|
||||||
|
export function registerAddressRoute(app, requireLogin) {
|
||||||
|
const ADDRESS_SERVICE_URL = process.env.ADDRESS_SERVICE_URL || 'https://noise.fuerst-stuttgart.de/srv/getaddress';
|
||||||
|
|
||||||
|
app.get('/api/address/:sensorNumber', requireLogin, async (req, res) => {
|
||||||
|
const sensorNumber = parseInt(req.params.sensorNumber, 10);
|
||||||
|
if (isNaN(sensorNumber)) {
|
||||||
|
return res.status(400).json({ error: 'Ungültige Sensornummer' });
|
||||||
|
}
|
||||||
|
const url = ADDRESS_SERVICE_URL + `?sensorid=${encodeURIComponent(sensorNumber)}`;
|
||||||
|
try {
|
||||||
|
const r = await fetch(url, { headers: { 'Accept': 'application/json' } });
|
||||||
|
if (!r.ok) {
|
||||||
|
return res.status(502).json({ error: `Adressdienst Fehler (${r.status})` });
|
||||||
|
}
|
||||||
|
const data = await r.json();
|
||||||
|
const addrObj = data?.erg?.address || data?.address || {};
|
||||||
|
const street = addrObj.street ?? '';
|
||||||
|
const plz = addrObj.plz ?? '';
|
||||||
|
const city = addrObj.city ?? '';
|
||||||
|
const rightPart = [plz, city].filter(Boolean).join(' ').trim();
|
||||||
|
const addressString = [street, rightPart].filter(Boolean).join(', ');
|
||||||
|
return res.json({
|
||||||
|
address: addressString,
|
||||||
|
parts: { street, plz, city }
|
||||||
|
});
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Address lookup failed:', err);
|
||||||
|
return res.status(504).json({ error: 'Adressdienst nicht erreichbar' });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
94
routes/api.js
Normal file
94
routes/api.js
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
import { ObjectId } from 'mongodb';
|
||||||
|
import bcrypt from 'bcrypt';
|
||||||
|
import { getCollections } from '../db/mongo.js';
|
||||||
|
|
||||||
|
export function registerApiRoutes(app, requireLogin) {
|
||||||
|
const { entriesCollection, usersCollection } = getCollections();
|
||||||
|
|
||||||
|
app.get('/api/check-email', async (req, res) => {
|
||||||
|
const email = (req.query.email || '').toLowerCase().trim();
|
||||||
|
if (!email) return res.json({ exists: false });
|
||||||
|
try {
|
||||||
|
const existingUser = await usersCollection.findOne({ email });
|
||||||
|
res.json({ exists: !!existingUser });
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
res.status(500).json({ error: 'Fehler bei der E-Mail-Prüfung' });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
app.post('/api/save', requireLogin, async (req, res) => {
|
||||||
|
let { espId, sensorNumber, name, description, address } = req.body;
|
||||||
|
if (!espId || !sensorNumber) {
|
||||||
|
return res.json({ error: 'ESP-ID und Sensornummer sind Pflichtfelder' });
|
||||||
|
}
|
||||||
|
sensorNumber = parseInt(sensorNumber, 10);
|
||||||
|
try {
|
||||||
|
const doc = {
|
||||||
|
espId,
|
||||||
|
sensorNumber,
|
||||||
|
name: name || '',
|
||||||
|
description: description || '',
|
||||||
|
address: address || '',
|
||||||
|
createdAt: new Date()
|
||||||
|
};
|
||||||
|
await entriesCollection.insertOne(doc);
|
||||||
|
res.json({ success: true });
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
res.status(500).json({ error: 'Fehler beim Speichern' });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
app.put('/api/update/:id', requireLogin, async (req, res) => {
|
||||||
|
const { id } = req.params;
|
||||||
|
let { espId, sensorNumber, name, description, address } = req.body;
|
||||||
|
if (!espId || !sensorNumber) {
|
||||||
|
return res.json({ error: 'ESP-ID und Sensornummer sind Pflichtfelder' });
|
||||||
|
}
|
||||||
|
sensorNumber = parseInt(sensorNumber, 10);
|
||||||
|
try {
|
||||||
|
await entriesCollection.updateOne(
|
||||||
|
{ _id: new ObjectId(id) },
|
||||||
|
{ $set: { espId, sensorNumber, name, description, address } }
|
||||||
|
);
|
||||||
|
res.json({ success: true });
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
res.status(500).json({ error: 'Fehler beim Aktualisieren' });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
app.get('/api/list', requireLogin, async (req, res) => {
|
||||||
|
const { id } = req.query;
|
||||||
|
if (id) {
|
||||||
|
try {
|
||||||
|
const item = await entriesCollection.findOne({ _id: new ObjectId(id) });
|
||||||
|
if (item) return res.json([item]);
|
||||||
|
return res.json([]);
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
return res.status(500).json({ error: 'Fehler beim Laden' });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const page = parseInt(req.query.page) || 1;
|
||||||
|
const limit = parseInt(req.query.limit) || 10;
|
||||||
|
const skip = (page - 1) * limit;
|
||||||
|
try {
|
||||||
|
const items = await entriesCollection.find({})
|
||||||
|
.sort({ createdAt: -1 })
|
||||||
|
.skip(skip)
|
||||||
|
.limit(limit)
|
||||||
|
.toArray();
|
||||||
|
res.json(items);
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
res.status(500).json({ error: 'Fehler beim Laden' });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
app.delete('/api/delete/:id', requireLogin, async (req, res) => {
|
||||||
|
await entriesCollection.deleteOne({ _id: new ObjectId(req.params.id) });
|
||||||
|
res.json({ success: true });
|
||||||
|
});
|
||||||
|
}
|
||||||
34
routes/auth.js
Normal file
34
routes/auth.js
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
import bcrypt from 'bcrypt';
|
||||||
|
import { getCollections } from '../db/mongo.js';
|
||||||
|
|
||||||
|
export function registerAuthRoutes(app) {
|
||||||
|
const { usersCollection } = getCollections();
|
||||||
|
|
||||||
|
app.get('/register', (req, res) => res.render('register', { error: null }));
|
||||||
|
|
||||||
|
app.post('/register', async (req, res) => {
|
||||||
|
const { email, password } = req.body;
|
||||||
|
if (!email || !password) return res.render('register', { error: 'Bitte Email und Passwort angeben.' });
|
||||||
|
const existingUser = await usersCollection.findOne({ email: email.toLowerCase() });
|
||||||
|
if (existingUser) return res.render('register', { error: 'Email schon registriert.' });
|
||||||
|
const hash = await bcrypt.hash(password, 10);
|
||||||
|
await usersCollection.insertOne({ email: email.toLowerCase(), passwordHash: hash });
|
||||||
|
res.redirect('/login');
|
||||||
|
});
|
||||||
|
|
||||||
|
app.get('/login', (req, res) => res.render('login', { error: null }));
|
||||||
|
|
||||||
|
app.post('/login', async (req, res) => {
|
||||||
|
const { email, password } = req.body;
|
||||||
|
const user = await usersCollection.findOne({ email: email.toLowerCase() });
|
||||||
|
if (!user) return res.render('login', { error: 'Falsche Email oder Passwort.' });
|
||||||
|
const match = await bcrypt.compare(password, user.passwordHash);
|
||||||
|
if (!match) return res.render('login', { error: 'Falsche Email oder Passwort.' });
|
||||||
|
req.session.userId = user._id;
|
||||||
|
res.redirect('/');
|
||||||
|
});
|
||||||
|
|
||||||
|
app.get('/logout', (req, res) => {
|
||||||
|
req.session.destroy(() => res.redirect('/login'));
|
||||||
|
});
|
||||||
|
}
|
||||||
227
server.js
227
server.js
@@ -1,37 +1,22 @@
|
|||||||
import express from 'express';
|
import express from 'express';
|
||||||
import session from 'express-session';
|
import session from 'express-session';
|
||||||
import bcrypt from 'bcrypt';
|
|
||||||
import { MongoClient, ObjectId } from 'mongodb';
|
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { fileURLToPath } from 'url';
|
import { fileURLToPath } from 'url';
|
||||||
import dotenv from 'dotenv';
|
import dotenv from 'dotenv';
|
||||||
dotenv.config();
|
dotenv.config();
|
||||||
|
|
||||||
|
import { initMongo } from './db/mongo.js';
|
||||||
|
import { registerApiRoutes } from './routes/api.js';
|
||||||
|
import { registerAuthRoutes } from './routes/auth.js';
|
||||||
|
import { registerAddressRoute } from './routes/address.js';
|
||||||
|
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
const __dirname = path.dirname(__filename);
|
const __dirname = path.dirname(__filename);
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
const PORT = process.env.PORT || 3000;
|
const PORT = process.env.PORT || 3000;
|
||||||
const MONGO_ROOT_USER = process.env.MONGO_ROOT_USER;
|
|
||||||
const MONGO_ROOT_PASSWORD = process.env.MONGO_ROOT_PASSWORD;
|
|
||||||
let MONGO_URI = process.env.MONGO_URI || 'mongodb://localhost:27017';
|
|
||||||
|
|
||||||
// If credentials are set, inject them into the URI
|
|
||||||
if (MONGO_ROOT_USER && MONGO_ROOT_PASSWORD) {
|
|
||||||
// Remove protocol and host from URI
|
|
||||||
const uriParts = MONGO_URI.split('://');
|
|
||||||
if (uriParts.length === 2) {
|
|
||||||
const protocol = uriParts[0];
|
|
||||||
const rest = uriParts[1];
|
|
||||||
MONGO_URI = `${protocol}://${encodeURIComponent(MONGO_ROOT_USER)}:${encodeURIComponent(MONGO_ROOT_PASSWORD)}@${rest}`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const DB_NAME = process.env.DB_NAME || 'espdb';
|
|
||||||
const SESSION_SECRET = process.env.SESSION_SECRET || 'supersecret';
|
const SESSION_SECRET = process.env.SESSION_SECRET || 'supersecret';
|
||||||
|
|
||||||
let db, entriesCollection, usersCollection;
|
|
||||||
|
|
||||||
// Middleware
|
|
||||||
app.use(express.urlencoded({ extended: true }));
|
app.use(express.urlencoded({ extended: true }));
|
||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
app.use(express.static(path.join(__dirname, 'public')));
|
app.use(express.static(path.join(__dirname, 'public')));
|
||||||
@@ -46,208 +31,22 @@ app.use(session({
|
|||||||
app.set('views', path.join(__dirname, 'views'));
|
app.set('views', path.join(__dirname, 'views'));
|
||||||
app.set('view engine', 'pug');
|
app.set('view engine', 'pug');
|
||||||
|
|
||||||
// MongoDB verbinden
|
// DB verbinden
|
||||||
async function initMongo() {
|
|
||||||
const client = new MongoClient(MONGO_URI);
|
|
||||||
await client.connect();
|
|
||||||
db = client.db(DB_NAME);
|
|
||||||
entriesCollection = db.collection('entries');
|
|
||||||
usersCollection = db.collection('users');
|
|
||||||
console.log(`MongoDB verbunden: ${MONGO_URI}/${DB_NAME}`);
|
|
||||||
}
|
|
||||||
await initMongo();
|
await initMongo();
|
||||||
|
|
||||||
// Login-Middleware
|
// Login-Middleware
|
||||||
function requireLogin(req, res, next) {
|
function requireLogin(req, res, next) {
|
||||||
// if (req.session.userId) return next();
|
// if (req.session.userId) return next();
|
||||||
// res.redirect('/login');
|
// res.redirect('/login');
|
||||||
return next()
|
return next();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Auth-Routen
|
// Routen registrieren
|
||||||
|
registerAuthRoutes(app);
|
||||||
app.get('/api/check-email', async (req, res) => {
|
registerApiRoutes(app, requireLogin);
|
||||||
const email = (req.query.email || '').toLowerCase().trim();
|
registerAddressRoute(app, requireLogin);
|
||||||
if (!email) return res.json({ exists: false });
|
|
||||||
|
|
||||||
try {
|
|
||||||
const existingUser = await usersCollection.findOne({ email });
|
|
||||||
res.json({ exists: !!existingUser });
|
|
||||||
} catch (err) {
|
|
||||||
console.error(err);
|
|
||||||
res.status(500).json({ error: 'Fehler bei der E-Mail-Prüfung' });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
app.get('/register', (req, res) => res.render('register', { error: null }));
|
|
||||||
|
|
||||||
app.post('/register', async (req, res) => {
|
|
||||||
const { email, password } = req.body;
|
|
||||||
if (!email || !password) return res.render('register', { error: 'Bitte Email und Passwort angeben.' });
|
|
||||||
|
|
||||||
const existingUser = await usersCollection.findOne({ email: email.toLowerCase() });
|
|
||||||
if (existingUser) return res.render('register', { error: 'Email schon registriert.' });
|
|
||||||
|
|
||||||
const hash = await bcrypt.hash(password, 10);
|
|
||||||
await usersCollection.insertOne({ email: email.toLowerCase(), passwordHash: hash });
|
|
||||||
res.redirect('/login');
|
|
||||||
});
|
|
||||||
|
|
||||||
app.get('/login', (req, res) => res.render('login', { error: null }));
|
|
||||||
|
|
||||||
app.post('/login', async (req, res) => {
|
|
||||||
const { email, password } = req.body;
|
|
||||||
const user = await usersCollection.findOne({ email: email.toLowerCase() });
|
|
||||||
if (!user) return res.render('login', { error: 'Falsche Email oder Passwort.' });
|
|
||||||
|
|
||||||
const match = await bcrypt.compare(password, user.passwordHash);
|
|
||||||
if (!match) return res.render('login', { error: 'Falsche Email oder Passwort.' });
|
|
||||||
|
|
||||||
req.session.userId = user._id;
|
|
||||||
res.redirect('/');
|
|
||||||
});
|
|
||||||
|
|
||||||
app.get('/logout', (req, res) => {
|
|
||||||
req.session.destroy(() => res.redirect('/login'));
|
|
||||||
});
|
|
||||||
|
|
||||||
// Hauptseite
|
// Hauptseite
|
||||||
app.get('/', requireLogin, (req, res) => res.render('index'));
|
app.get('/', requireLogin, (req, res) => res.render('index'));
|
||||||
|
|
||||||
// API-Routen (Beispiel)
|
|
||||||
app.post('/api/save', requireLogin, async (req, res) => {
|
|
||||||
let { espId, sensorNumber, name, description, address } = req.body;
|
|
||||||
if (!espId || !sensorNumber) {
|
|
||||||
return res.json({ error: 'ESP-ID und Sensornummer sind Pflichtfelder' });
|
|
||||||
}
|
|
||||||
|
|
||||||
sensorNumber = parseInt(sensorNumber, 10); // als Integer speichern
|
|
||||||
|
|
||||||
try {
|
|
||||||
const doc = {
|
|
||||||
espId,
|
|
||||||
sensorNumber,
|
|
||||||
name: name || '',
|
|
||||||
description: description || '',
|
|
||||||
address: address || '',
|
|
||||||
createdAt: new Date()
|
|
||||||
};
|
|
||||||
await entriesCollection.insertOne(doc);
|
|
||||||
res.json({ success: true });
|
|
||||||
} catch (err) {
|
|
||||||
console.error(err);
|
|
||||||
res.status(500).json({ error: 'Fehler beim Speichern' });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Neuer Endpoint zum Bearbeiten
|
|
||||||
app.put('/api/update/:id', requireLogin, async (req, res) => {
|
|
||||||
const { id } = req.params;
|
|
||||||
let { espId, sensorNumber, name, description, address } = req.body;
|
|
||||||
|
|
||||||
if (!espId || !sensorNumber) {
|
|
||||||
return res.json({ error: 'ESP-ID und Sensornummer sind Pflichtfelder' });
|
|
||||||
}
|
|
||||||
|
|
||||||
sensorNumber = parseInt(sensorNumber, 10);
|
|
||||||
|
|
||||||
try {
|
|
||||||
await entriesCollection.updateOne(
|
|
||||||
{ _id: new ObjectId(id) },
|
|
||||||
{ $set: { espId, sensorNumber, name, description, address } }
|
|
||||||
);
|
|
||||||
res.json({ success: true });
|
|
||||||
} catch (err) {
|
|
||||||
console.error(err);
|
|
||||||
res.status(500).json({ error: 'Fehler beim Aktualisieren' });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
app.get('/api/list', requireLogin, async (req, res) => {
|
|
||||||
const { id } = req.query;
|
|
||||||
if (id) {
|
|
||||||
try {
|
|
||||||
const item = await entriesCollection.findOne({ _id: new ObjectId(id) });
|
|
||||||
if (item) return res.json([item]);
|
|
||||||
return res.json([]);
|
|
||||||
} catch (err) {
|
|
||||||
console.error(err);
|
|
||||||
return res.status(500).json({ error: 'Fehler beim Laden' });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const page = parseInt(req.query.page) || 1;
|
|
||||||
const limit = parseInt(req.query.limit) || 10;
|
|
||||||
const skip = (page - 1) * limit;
|
|
||||||
|
|
||||||
try {
|
|
||||||
const items = await entriesCollection.find({})
|
|
||||||
.sort({ createdAt: -1 })
|
|
||||||
.skip(skip)
|
|
||||||
.limit(limit)
|
|
||||||
.toArray();
|
|
||||||
res.json(items);
|
|
||||||
} catch (err) {
|
|
||||||
console.error(err);
|
|
||||||
res.status(500).json({ error: 'Fehler beim Laden' });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
app.delete('/api/delete/:id', requireLogin, async (req, res) => {
|
|
||||||
await entriesCollection.deleteOne({ _id: new ObjectId(req.params.id) });
|
|
||||||
res.json({ success: true });
|
|
||||||
});
|
|
||||||
|
|
||||||
// Dummy-Funktion - hier später Logik implementieren
|
|
||||||
function getAddress(sensorNumber) {
|
|
||||||
|
|
||||||
// Beispiel: feste Testwerte oder Datenbank-Logik
|
|
||||||
const addressMap = {
|
|
||||||
1001: 'Musterstraße 1, 12345 Musterstadt',
|
|
||||||
2002: 'Beispielweg 5, 54321 Beispielstadt'
|
|
||||||
};
|
|
||||||
return addressMap[sensorNumber] || 'Adresse nicht gefunden';
|
|
||||||
}
|
|
||||||
|
|
||||||
// .env (optional): ADDRESS_SERVICE_URL=https://noise.fuerst-stuttgart.de/srv/getaddress
|
|
||||||
const ADDRESS_SERVICE_URL = process.env.ADDRESS_SERVICE_URL
|
|
||||||
|| 'https://noise.fuerst-stuttgart.de/srv/getaddress';
|
|
||||||
|
|
||||||
|
|
||||||
// /api/address/:sensorNumber – holt Adresse als String "Straße, PLZ Stadt"
|
|
||||||
app.get('/api/address/:sensorNumber', requireLogin, async (req, res) => {
|
|
||||||
const sensorNumber = parseInt(req.params.sensorNumber, 10);
|
|
||||||
if (isNaN(sensorNumber)) {
|
|
||||||
return res.status(400).json({ error: 'Ungültige Sensornummer' });
|
|
||||||
}
|
|
||||||
|
|
||||||
const url = ADDRESS_SERVICE_URL + `?sensorid=${encodeURIComponent(sensorNumber)}`;
|
|
||||||
|
|
||||||
try {
|
|
||||||
const r = await fetch(url, { headers: { 'Accept': 'application/json' } });
|
|
||||||
if (!r.ok) {
|
|
||||||
return res.status(502).json({ error: `Adressdienst Fehler (${r.status})` });
|
|
||||||
}
|
|
||||||
|
|
||||||
const data = await r.json();
|
|
||||||
// Erwartete Struktur: { erg: { address: { street, plz, city } } }
|
|
||||||
const addrObj = data?.erg?.address || data?.address || {};
|
|
||||||
|
|
||||||
const street = addrObj.street ?? '';
|
|
||||||
const plz = addrObj.plz ?? '';
|
|
||||||
const city = addrObj.city ?? '';
|
|
||||||
|
|
||||||
const rightPart = [plz, city].filter(Boolean).join(' ').trim();
|
|
||||||
const addressString = [street, rightPart].filter(Boolean).join(', ');
|
|
||||||
|
|
||||||
return res.json({
|
|
||||||
address: addressString, // <- vom Client direkt ins Inputfeld
|
|
||||||
parts: { street, plz, city } // optional, falls du es später brauchst
|
|
||||||
});
|
|
||||||
} catch (err) {
|
|
||||||
console.error('Address lookup failed:', err);
|
|
||||||
return res.status(504).json({ error: 'Adressdienst nicht erreichbar' });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
app.listen(PORT, () => console.log(`Server läuft auf http://localhost:${PORT}`));
|
app.listen(PORT, () => console.log(`Server läuft auf http://localhost:${PORT}`));
|
||||||
Reference in New Issue
Block a user