Answer the question
In order to leave comments, you need to log in
Why can't I set up an external ip for the webserver right away in NodeJS?
I have server.js web server
et http = require('http'),
fs = require('fs'),
url = require('url'),
path = require('path'),
cmd = require('node-cmd'),
Tail = require('tail').Tail;
let server = new http.Server(); // EventEmitter
let ip = '127.0.0.1';
let port = 8000;
server.listen(port, ip);
console.log(`server listen http://${ip}:${port} ... \n`);
server.on("connection", () => console.log("connection"));
server.on('request', (request, response) => {});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question