gone
gone

Reputation: 2627

What logic goes where: express + jade/ejs + html5 + css + websockets

OK. I'm trying to learn node.js/express and want to clarify how jade/ejs, html, and css all fit together. Correct me if I'm wrong:

  1. Application logic is done in node.js/express
  2. Some of this logic/variables is passed into jade/ejs html engine to dynamically serve html
  3. CSS still formats the served html depending on requesting device.

Forgive me, it just seems like lines are starting to blur with all this JS; it's hard to tell what logic should be done in node.js/express and what logic should be done in jade/ejs.

This gets even blurrier when using websockets, since there is logic going on the client-side. So there's display control logic going on at 5 different places.

Upvotes: 2

Views: 1379

Answers (1)

anglinb
anglinb

Reputation: 985

You pretty much have it! Here is a really good to tutorial that I think would help clear up any confusion if you have the time to take a look at it. It uses all of the modules you mentioned and does a good job explaining what the role of each element is.

http://net.tutsplus.com/tutorials/javascript-ajax/real-time-chat-with-nodejs-socket-io-and-expressjs/

Upvotes: 2

Related Questions