No images? Click here Build a page counter service in NodeNode.js is a JavaScript runtime built on Chrome’s V8 JavaScript engine, which enables you to run JavaScript code on the server. It has excellent support for modern JavaScript, using the latest and most modern syntax. It's fast and scalable. An often-touted advantage of using JavaScript on a web server—as well as in the browser—is that your brain no longer needs to switch modes. You can do everything in the same language, which, as a developer, makes you more productive (and hopefully, happier). In Chapter 2 of Your First Week With Node.js, you'll build your first Node app: a simple page counter service that can be used to display “this page has been viewed X times”, just like HTML developers did twenty years ago. You'll start by builiding a counter that stores the number of views in memory, and then refine that counter to make use of file storage so that the view count is not lost when he Node application is restarted. Along the way you'll discover how to initialize a Node application and get an introduction to some of Node's commonly used modules. Your First Week With Node.js, 2nd EditionThis practical, short book offers a beginner's introduction to Node and its related technologies, and gets you under way writing your first Node applications. You'll learn about working with databases, authentication, debugging, testing, and much more. Start your subscription today and you'll get access to this book, plus 300+ other web design and development books in SitePoint Premium! This week, new subscribers can get 60% off for the first three months. That’s $3 a month to access 400+ tech books and courses — grab the deal here. Until next time, |