Welcome aboard! We are happy you are here and wish you good net-raft!
// you must install npm i country-list
var countries = require('country-list')();
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
var myData = countries.getNames();
res.write('<select>');
for (var i = 0; i < myData.length; i++) {
res.write('<option>' + myData[i] + '</option>'); // retrieve from the array
}
res.write('</select>');
res.end();
}).listen(3000);
console.log("Listening to Port 3000");
The most helpful NODEJS solutions
get user ipNODEJS Click to see more ... 7.6K 1.7K