Monday 8 May 2017

This site can’t be reached refused to connect

I am deploying my node app on server , and its working fine when type something in console but when i try to run it with browser , i got a error

This site can’t be reached refused to connect.

here is my code

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

app.get('/hello.txt',function(req,res){
res.send('hello world');
});

var server = app.listen(3000, function(){
console.log("listening on port number", server.address().port);
});

run my code on server: node server.js

i call the api on browser using http://Dedicated_ip_address:3000/hello.txt Now i don't know why my app is not working when calling in browser. any help will be greatly appreciated.



via Shekhar Tyagi

No comments:

Post a Comment