Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Simple Node Server

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #191576
    justdan
    Participant

    I recently picked the book Pro Angular JS. I ran through the intro parts that really didn’t rely on a node server to be running, but I’m to a point now where I need one. For some reason though I cannot get the setup from the book to run. I did the node test to make sure it was installed properly and that worked fine. Step 2 was to run “npm install connect” from the node.js installation directory. I didn’t install node myself on this mac, so I thought I could just run that command on the desktop through terminal. I did that and created a file for the server code that looks like:

    var connect = require(‘connect’);

    connect.createServer(
    connect.static(“angularjs”)
    ).listen(5000);

    Both the server.js file and the angularjs folder are located on my desktop. Whenever I try to run this though, I get an error in terminal saying “has no method static”. Is this because my files on the desktop are in the wrong place? Things like this are generally never an issue, and I’ve even used simple node servers before, but after about 20 various tries I think I’m definitely missing something. Thanks for your help.

Viewing 1 post (of 1 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.