node.js


Access node app on digital ocean - This site can't be reached


I am unable to access my digital ocean node js app. I've already SSH'ed in, cloned my Node app from Git, npm installed, and successfully started the app on the droplet, yet I get error
This site can't be reached
Digital Ocean docs say you can access your publicly facing website simply by going to <your website's ip>:<port>:
I did this by going to 67.205.185.63:9000/ (my app is running on port 9000 as you can see):
root#nodejs-512mb-nyc1-01:~/demos# npm start
live-demos#1.0.0 start /root/demos
node app.js
Demos is listening on port 9000
How else should I be accessing my node app?
var express = require('express');
var bodyParser = require('body-parser');
var app = express();
var port = process.env.PORT || 9000;
...
app.listen(port, function () {
console.log('Demos is listening on port ' + port);
});
Some Digital Ocean droplets (mainly one-click apps) come with ufw firewall installed and by default all ports except for 22, 80, and 443 are blocked.
To check if ufw is installed and which ports are blocked/open do:
sudo ufw status
Output:
To Action From
-- ------ ----
22 LIMIT Anywhere
80 ALLOW Anywhere
443 ALLOW Anywhere
22 (v6) LIMIT Anywhere (v6)
80 (v6) ALLOW Anywhere (v6)
443 (v6) ALLOW Anywhere (v6)
To allow traffic on port 9000 do:
sudo ufw allow 9000/tcp

Related Links

why mongoose queries dos not work when put inside promise function
How do I export a node.js module which is inside the Promise.all (somefunction) . then (function (){})
How to fix error when installing node.js on windows 7 32bit
PdfKit doc.pipe() error
Add custom login form to hapi-auth-basic
start command not working with node js firereader
node js scheduler iterates 3 times while it supposed to Fire only one Time
Rename uploaded images using MULTER
jsDoc: how to get object of required module
How do I send a buffer in an HTTP request?
MongoDB connection with Robomong
Use Axios or fetch to make self REST Api call inside Node?
How to run Ramme with sourcecode
How to get multiple content areas in hapi.js ejs layouts?
How to perform a partial update in loopback mongodb connector through updateAttributes
Best practices form processing with Express

Categories

HOME
neural-network
reverse-geocoding
alexa
firmware
composer-php
statistics
scenekit
g2o
keen-io
zurb-foundation
import
binary
google-cloud-kms
filesystems
acr122
cordova-plugins
gemfire
ccache
zk
row-number
m3u8
amazon-route53
eventtrigger
pyvmomi
sqlanywhere
jquery-animate
fgets
ssrs-2016
react-apollo
amazon-lightsail
github-api
nodemon
geckofx
mahapps.metro
spring-4
side-effects
modeling
omnipay
nexmo
phpexcel-1.8.0
tensorflow-serving
state
direct3d9
google-optimize
regedit
envelope
moa
smartassembly
lift
3d-modelling
oclazyload
grunt-string-replace
falcor
xc8
http-status-code-415
api-manager
exceljs
subtitle
cakephp-3.3
invoke
coupling
heyzap
sift
prime-factoring
bubble-sort
simplehttpserver
local-variables
itil
pubsubhubbub
unicorn
compass
smf
android-selector
website-deployment
oql
firefox-addon-bootstrap
graphic-effects
spawn-fcgi
mediafire
sos
http-accept-header
frontpage
backspace
max-heap
cirqus
xcode-bots
euclidean-distance
acl2
mpi4py
reagent
soundex
scrollviewer
android-view
function-prototypes
mooc
sqloledb
appcompat-v7-r22.1
xcode6.1
cxf-client
firstdata
opendocument
django-1.2
ubuntu-13.04
delphiscript
boost-spirit-karma
angularjs-e2e
kendo-tooltip
dynamic-languages
jwebunit
enctype
gwt-2.5
shadowbox
wymeditor
dynamic-content
looper
cloning
xmlnodelist
iphone-sdk-4.1
winqual
openflashchart2
viewexpiredexception
multiple-versions
installshield-2008
orbited

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile