Bind webserver to localhost by default
This commit is contained in:
5
app.js
5
app.js
@@ -12,7 +12,8 @@ const webdir_from_module = path.join(path.dirname(fileURLToPath(import.meta.url)
|
|||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
hostname: process.env.HOSTNAME || 'localhost',
|
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,
|
webdir: process.env.WEBDIR || webdir_from_module,
|
||||||
name: 'db-vendo-client',
|
name: 'db-vendo-client',
|
||||||
description: 'db-vendo-client',
|
description: 'db-vendo-client',
|
||||||
@@ -41,7 +42,7 @@ const start = async () => {
|
|||||||
app.use("/api", api);
|
app.use("/api", api);
|
||||||
app.use('/', express.static(config.webdir));
|
app.use('/', express.static(config.webdir));
|
||||||
|
|
||||||
app.listen(config.port, (err) => {
|
app.listen(config.port, config.address, (err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user