At the Forge - Node.JS

Want to write high-performance network server applications? Node.JS uses JavaScript to do exactly that.

Actually, that's not entirely true. Express looks for a layout, much as Rails templates do, and if it doesn't find a layout, it'll throw an exception. You could create a layout, but it's easier just to modify the express application's configuration. Do that by setting parameters inside app.set:

app.set('view options', {
  layout: false
    });

Once that is added, your template is rendered just fine.

Conclusion

Node.JS already has started to affect the way that people write Web applications and even how they think about writing Web applications. Some sites (such as GitHub) have moved toward Node.JS for specific, high-performance tasks. Others are looking to change over completely. I don't think I'll be using Node.JS for a Web application any time soon, but I can think of several other ways it would be useful. Node.JS already has had a huge impact on the world of Web developers, and it appears poised to continue to hold this position of leadership for some time to come. Certainly, the days when I scoffed at the notion of server-side JavaScript have long gone.

Reuven M. Lerner is a longtime Web developer, architect and trainer. He is a PhD candidate in learning sciences at Northwestern University, researching the design and analysis of collaborative on-line communities. Reuven lives with his wife and three children in Modi'in, Israel.

______________________

Geek Guide
The DevOps Toolbox

Tools and Technologies for Scale and Reliability
by Linux Journal Editor Bill Childers

Get your free copy today

Sponsored by IBM

Webcast
8 Signs You're Beyond Cron

Scheduling Crontabs With an Enterprise Scheduler
On Demand
Moderated by Linux Journal Contributor Mike Diehl

Sign up now

Sponsored by Skybot