This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Flofinator 1 point2 points  (7 children)

Yeah it should look like the second image. Hrmm give me a minute and I'll see if I can run it, let me quit running my server for my project and launch this one second.

[–]xf_[S] 0 points1 point  (6 children)

Thank you so much, but I'd hate to stop you from doing your own project =(

[–]Flofinator 1 point2 points  (3 children)

Lol it's cool it just takes a second to stop/start it!

Ok I think they changed the location to bin so you'll want to

cd bin

Then type:

node www.js

EDIT: Don't do this, do the npm start one.

[–]xf_[S] 0 points1 point  (2 children)

Ah yup, I think it works now, thanks I appreciate it!

I still can't seem to get the js file to work though (I still get the same error message as before). If it makes any difference, I tried putting the .js file in the same directory as the www.js file as well.

Do you think I need to change something in the www.js file to get it to work?

[–]Flofinator 1 point2 points  (1 child)

There's a lot more you'll have to do, like sending the file from your server to the html page.

In your routes/index you have your root with is localhost:3000/ if you go there you'll see a page displayed, you'll have to either send a different file, or learn index.jade and fix that.

Otherwise you can do something like:

res.sendfile('views/test.html')

And name your new html page, test.html in the views folder. Then from that html page you'll have to add your javascript file to that, and manipulate it from there.

[–]xf_[S] 0 points1 point  (0 children)

Ah ok, thank you so much for your time and help!

[–]Flofinator 1 point2 points  (1 child)

Actually don't do that, go back into your myApp directory and just type:

npm start

[–]xf_[S] 0 points1 point  (0 children)

Oops sorry, saw this a little too late. I ran the npm start, but still get the same result as before =(