0

I’m good at jQuery but I’m new to modern js frameworks introduced over the last couple of years. I understand how index.html works in the following example and I can infer that server.js serves the request made from index.html. However, I’m not clear on how server.js gets initialized.

http://codeforgeek.com/2014/07/send-e-mail-node-js/#comment-18703

There does not appear to be a src ref from index.html to server.js which appears to indicate that server.js gets initialized in some other way although that's all I'm able to infer. This is a knowledge gap on my end but can you explain how to initialize server.js so that it can be called by index.html?

2
  • you start node server by typing in node server.js Commented Dec 14, 2014 at 7:19
  • 1
    Node.js doesn't have a direct tie to HTML, jQuery, etc. It's a JavaScript runtime that's often "server-side," operating separately from the browser, typically started from a command line -- $ node server.js. blog.modulus.io/absolute-beginners-guide-to-nodejs Commented Dec 14, 2014 at 7:37

1 Answer 1

1

Node.js is a platform built on top of javascript. Non blocking threads due to its asynchronous behaviour, still event driven.

Node.js provision many use cases. You can refer this & this.

Coming to your point is required to create a webserver on top of node.js http/https modules. Once this server started by nodejs, it is ready to serve http clients.

Open source dev communities built some of great web app framework like express which are easy to learn. github, npmjs are full of great node modules / packages which are ready to plug into your app.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.