Tuesday 14 March 2017

Express - public server

Use Ubuntu

Have Express app with Hello world. I wanna run app as public, setup static ip like in this video. It is my express server app:

var express = require('express');
var app = express();

app.get('/', function (req, res) {
  res.send('Hello World!');
});

var listener = app.listen(3000, function () {
  console.log('Example app listening on port 3000!');
  console.log(listener.address());// { address: '::', family: 'IPv6', port: 3000 }
});

I check my inet address with ifconfig command and get 192.168.0.102 - it is local IP address and when I enter 192.168.0.102:3000 I get Hello world. But when I try 194.242.103.139:3000 didn't have success. I am new with this stuff, please help and if you can with more details.

Thanks.



via Metal Evolution Studio

No comments:

Post a Comment