Bind webserver to localhost by default

This commit is contained in:
2025-07-06 17:45:17 +02:00
parent 7b2d58600e
commit bb8c578ade

5
app.js
View File

@@ -12,7 +12,8 @@ const webdir_from_module = path.join(path.dirname(fileURLToPath(import.meta.url)
const config = {
hostname: process.env.HOSTNAME || 'localhost',
port: process.env.PORT ? parseInt(process.env.PORT) : 3000,
port: process.env.HTTP_PORT ? parseInt(process.env.HTTP_PORT) : 3000,
address: process.env.HTTP_ADDRESS || '::1',
webdir: process.env.WEBDIR || webdir_from_module,
name: 'db-vendo-client',
description: 'db-vendo-client',
@@ -41,7 +42,7 @@ const start = async () => {
app.use("/api", api);
app.use('/', express.static(config.webdir));
app.listen(config.port, (err) => {
app.listen(config.port, config.address, (err) => {
if (err) {
console.error(err);
}