Question

I have a Debian 6 server that runs several domains.

I have created a new domain (that functions perfectly as a website), but I want to create a node.js scripts that listens on that domain.

Doesn't have to be a specific port, it can be the entire domain as far as I am concerned, but for simplicity I am trying to test on port3000

The directory structure is

domainname/public/(static content)

I am running the node at the domainname/ level.. i.e one level below the webcontent. I have a test index.html file in the public folder (which works fine). The test script is

var connect = require('connect');

var app = connect()
    .use(connect.static('public'))
    .use(function (req, res) {
        res.end("Couldn't find it.");
    })
    .listen(3000);

the script runs but going to

http://domainname:3000

just throws me a page cannot be found error.

Any advice would be gratefully appreciated. Either a script change, or a different module maybe

Was it helpful?

Solution

Ultimately, there was too much going on with regards to the server which was already a full functional website.

I ended up creating an EC2 micro instance on AWS, installing NODE afresh, opening up the required port and uploading my code and BOOM worked first time.

Thanks for all those taking time to offer an answer

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top