Wednesday 30 November 2016

Deploying Node w/ Express App to DigitalOcean: App Won't Run On Port 3000

My Express app is on a Ubuntu 16.04 DigitalOcean server with Node installed.As a basic test I ran my server.js file with this command: node server.js Then I tested the file with: curl http://localhost:3000 however this returned Cannot GET /.I tested a separate app.js file without Express using a simple HTTP server and it returned anything I wanted regardless of port number. In other words, it isn't a firewall issue.Express module is installed.I think it may be a problem with my Express implementation. Here is my server.js:var express = require('express'); var app = express(); app.listen(3000, function () { console.log("express has started on port 3000"); }); Any advice on how else to troubleshoot this issue?

Submitted December 01, 2016 at 06:23AM by joWebDev

No comments:

Post a Comment