test ipaddress

This commit is contained in:
alexmorenograu 2021-09-24 08:10:40 +02:00
parent d9cbb56558
commit b031dcf9c7
3 changed files with 9 additions and 0 deletions

5
package-lock.json generated
View File

@ -862,6 +862,11 @@
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
},
"ip": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz",
"integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo="
},
"ipaddr.js": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",

View File

@ -14,6 +14,7 @@
"eslint-config-google": "^0.14.0",
"express": "^4.17.1",
"got": "^11.8.2",
"ip": "^1.1.5",
"mysql": "^2.18.1"
}
}

View File

@ -1,5 +1,7 @@
const express = require('express');
const app = express();
const ip = require('ip');
const ipAddress = ip.address();
const port = 7777;
const logIn = require('./methods/logIn');
const con = require('./db/connect');
@ -16,4 +18,5 @@ app.use('/flashOn', require('./methods/flashOn'));
app.listen(port, () => {
console.info(`http://localhost:${port}`);
console.log(`Network access via: ${ipAddress}:${port}!`);
});