CoffeeScript: The Good Parts-Write Better JavaScript

I’ve published a new short course on CoffeeScript. The course will teach you major benefits of using CoffeeScript to write better JavaScript code for both browser and server.

You can save 66% off and get this course for only $3 with the code “wal”, or by clicking this link —>>> https://www.udemy.com/coffeescript/?couponCode=wal.

As always, the course has some bonus content. More information and preview is available as well.

Pro Express.js Q&A (Recording)

Last week, I did a live Q&A session for people who bought my new book Pro Express.js, but you can watch the recording here. Click on the apps icon (next to the ? icon), and then click on the Q&A button to see the questions. If you haven’t bought Pro Express.js, then you can do it on Amazon.com… and start mastering the framework for you Node.js web development.

PS: You can also watch the session on YouTube, but I recommend Google +.

Here is the summary of questions and answers which you can also get in a PDF —>>> Pro Express.js Q&A, or read below.

Continue reading “Pro Express.js Q&A (Recording)”

Pro Express.js: Master Express.js—The Node.js Framework For Your Web Development Is Out

The long-anticipated Express.js manual is ready and was sent to to print at this week (December 24, 2014). To summarize the book, Pro Express.js: Master Express.js—The Node.js Framework For Your Web Development is all about understanding Express.js and building web apps with this framework and its middleware. Spend two minutes to read this post, to know how you can benefit from this valuable resource and the release.

Pro Express.js: Master Express.js—The Node.js Framework For Your Web Development Is Out
Pro Express.js: Master Express.js—The Node.js Framework For Your Web Development Is Out

Becoming a Better Node.js Developer

If you an intermediate or advanced beginner Node.js developer and want to become better at this cool, new technology, then you have lots of questions about the best practices and patterns. Most likely you’ve encountered Express.js, and you wish you knew more about useful settings and options to configure Express.js and its middleware.

The reason why I know these things is that, before I became proficient with Node.js and Express.js, I was a beginner just like you. Also, I’ve been in a position when I needed to learn Express.js quickly. In those sad moments, I was flat out miserable and often had to read the source code for the lack of a good documentation and examples. I wish I had Pro Express.js with me back then to explain the mechanisms in plain English, and provide inspiring code patterns that I could re-use in my projects. That’s why I’m confident that Pro Express.js will be great for intermediate Node.js developers (and advanced-beginners).

Pro Express.js can solve your pains and problems by providing the following benefits:

Continue reading “Pro Express.js: Master Express.js—The Node.js Framework For Your Web Development Is Out”

URL Parameters and Routing in Express.js

TL;DR: This post is about URL parameters and routing in Express.js, and it’s an excerpt (Chapter 6) from my new book Pro Express.js: Master Express.js—The Node.js Framework For Your Web Development. The book was released this week (~December 24, 2014), but we have a great limited-time offer for you which will be announced on Sunday, December 28, 2014 on Webapplog.com. This post is the last post in the series of excerpts from Pro Express.js with other posts as follow: Error Handling and Running an Express.js App, Express.js Security Tips, LoopBack 101: Express.js on Steroids, Sails.js 101 and Secret Express.js Settings.

To review, the typical structure of an Express.js app fig(which is usually a server.js or app.js file) roughly consists of these parts, in the order shown:

  1. Dependencies : A set of statements to import dependencies

  2. Instantiations : A set of statements to create objects

  3. Configurations : A set of statements to configure system and custom settings

  4. Middleware : A set of statements that is executed for every incoming request

  5. Routes : A set of statements that defines server routes, endpoints, and pages

  6. Bootup : A set of statements that starts the server and makes it listen on a specific port for incoming requests

This chapter covers the fifth category, routes and the URL parameters that we define in routes. These parameters, along with the app.param() middleware, are essential because they allow the application to access information passed from the client in the URLs (e.g., books/proexpressjs). This is the most common convention for REST APIs. For example, the http://hackhall.com/api/posts/521eb002d00c970200000003 route will use the value of 521eb002d00c970200000003 as the post ID.

Parameters are values passed in a query string of a URL of the request. If we didn’t have Express.js or a similar library, and had to use just the core Node.js modules, we’d have to extract parameters from an HTTP.request object via some require('querystring').parse(url) or require('url').parse(url, true) function “trickery.”

Let’s look closer at how to define a certain rule or logic for a particular URL parameter.

Continue reading “URL Parameters and Routing in Express.js”

Error Handling and Running an Express.js App

TL;DR: This text is an excerpt (Chapter 9) from Pro Express.js: Master Express.js—The Node.js Framework For Your Web Development. The book will be released next week (December 24, 2014), and we’ll announce a great limited-time offer on it on Sunday, December 28, 2014. So stay tuned… and happy Holidays!!!

Good web applications must have informative error messages to notify clients exactly why their request has failed. Errors might be caused either by the client (e.g., wrong input data) or by the server (e.g., a bug in the code).

The client might be a browser, in which case the application should display an HTML page. For example, a 404 page should display when the requested resource is not found. Or the client might be another application consuming our resources via the REST API. In this case, the application should send the appropriate HTTP status code and the message in the JSON format (or XML or another format that is supported). For these reasons, it’s always the best practice to customize error-handling code when developing a serious application.

In a typical Express.js application, error handlers follow the routes. Error handling deserves its own section of the book because it’s different from other middleware. After the error handlers, we’ll cover the Express.js application methods and ways to start the Express.js app. Therefore, the major topics of this chapter are as follows:

  • Error handling
  • Running an app

Continue reading “Error Handling and Running an Express.js App”

Express.js Security Tips

TL;DR

This text is part of my new book Pro Express.js: Master Express.js—The Node.js Framework For Your Web Development [Apress, 2014]. Security is important, that’s why I decided to publish this chapter on my blog. The book will be released very soon.

The set of tips in this chapter deals with security in Express.js applications. Security is often a neglected topic that is deferred until the last minute before the release. Obviously, this approach of treating security as an afterthought is prone to leaving holes for attackers. A better approach is to consider and implement security matters from the ground up.
Continue reading “Express.js Security Tips”

The Node Frameworks Contributor

I want to express gratitude to Randson Oliveira for his contributions to the Node Frameworks project. In fact, he is the #1 contributor on the project right now. Thank you for your dedication!

The Node Frameworks Contributor
The Node Frameworks Contributor

If you don’t know what the Node Frameworks project is about—check it out. The mission of this resource is to provide recommendations and one place for discovering Node.js frameworks and tutorials/examples for them. The stats for each library is really interesting to compare.

LoopBack 101: Express.js on Steroids

LoopBack is a comprehensive Node.js web framework with a rich command-line scaffolding and a web API explorer: strongloop.com/node-js/loopback. The framework is maintained by StrongLoop which is also the gate-keeper of Express.js.

This concise tutorial will illustrate how to get started with LoopBack and the common traits between LoopBack and Express.js. This text is from my new book Pro Express.js by Apress which you can already start reading in Apress Alpha or pre-order on Amazon.com and other bookstores.

Continue reading “LoopBack 101: Express.js on Steroids”

Azat Mardan on NodeJS and Express Interview at QConNY 2014

Here’s my interview with Brian Rinaldi of ModernWeb on NodeJS and Express at QConNY 2014 where I spoke about CoffeeScript. The inverview is 13 minutes long and discusses some controversial topics and my traditionally published book Practical Node.js.

Continue reading “Azat Mardan on NodeJS and Express Interview at QConNY 2014”

Guide to Hiring Your First Developer for Non-Techies

One of The Foundation members asked in forum, “How do I find a good developer?”. I was glad to help, but then I thought that others might benefit from this advice so I answered it via a post.

The best thing is to work on something small first. This way you’ll test the waters before putting a major project under risk. This might include a test or a real, but small task, (preferably outside of the main project) like writing a bookmarklet or a scrapper.

Continue reading “Guide to Hiring Your First Developer for Non-Techies”

Webapplog Apprenticeship

In August, I posted an idea of a three-month apprenticeship in web development and Node.js:

I only wanted to test the water, and was surprised that I got over 20 requests. Therefore, I went ahead with the interview process in order to select one aspiring Node.js programmer…

Continue reading “Webapplog Apprenticeship”

Job Security is Dead But There Is a Way

There is no such thing as a job security. You can trust my word on this, because I worked for one of the most stable employers in the world, the U.S. federal government, during 2007–2008, and had seen a lot of bright software engineers, analysts, technical writers, quality assurance engineers, and project managers let go due to the market downturn and budget cuts. Startups and private corporations are even more brutal. They won’t even give you a two-week notice! I know of a company that fired its lead software engineer with just ONE hour of notice… poor fellow didn’t expect it at all when he was coming to work in the morning just to go back home for the rest of the day right away!

Continue reading “Job Security is Dead But There Is a Way”

NodeFrameworks.com Got GitHub Stats

Now our hand-picked registry of Node.js frameworks (NodeFrameworks.com) has GitHub statistics right on the website, so you don’t have to navigate back and forth when making a decision!

This is how it looks: each framework has a number (GitHub stars) next to its name. This serves as a social proof meaning the more people use the framework the more robust it is and the less bugs it has.

GitHub stats on NodeFrameworks.com
GitHub stats on NodeFrameworks.com

The buttons provided by the service called GitHub Buttons. The links to the frameworks’ GitHub, NPM, examples and other resources are hidden under the “i” icon.

Thank you Randson Oliveira for contributing and making pull requests!

Punishment for Becoming Better

If you do something for a living every day (i.e., you have a job) you have two choices:

  • Learn and become better: this is the default path for most people (it’s hard to do something over and over without getting better at it).
  • Stagnate and regress: this is actually harder than progress, and may require some subconscious proactive self-sabotage.

So everything is better if we automatically make progress, right? Not quite, because when we make progress, other people (including bosses) start to notice, and they then give/bring/order more of the same work—not a new type of work. Usually it’s the same stuff you’ve been doing already (and for the same money), because management doesn’t want to lose a good producer. I call this punishment for becoming better.

Continue reading “Punishment for Becoming Better”

Secret Express.js Settings

Express.js is one of the top Node.js frameworks out there. It was used in the overwhelming majority of projects that I’ve encountered since I began working with Node.js in 2011. One of the main selling points and key differentiators is the framework’s configurability. However, while writing Express.js Guide and Pro Express.js, I discovered a few secret settings never mentioned in their documentation.

Continue reading “Secret Express.js Settings”

The Foundation: Starting from Nothing

Last year, at about this same time, I discovered The Foundation podcast. I was vacationing in Mexico and stumbled on it via Pat Flynn’s Smart Passive Income—a hyper-popular online infopreneur. I downloaded and listened to many similar podcasts on online business, but The Foundation surprised me in the magnitude of its guests’ success stories. These weren’t the product of a few niche blogs, life coaching and ebooks, but six figures per month (and up) marketing and SaaS companies.

Continue reading “The Foundation: Starting from Nothing”

Time to Up Your Node.js Skills

Are you a software engineer who wants to master an effective and fun-to-use, new platform Node.js? Is your goal to stay on top of the curve with cutting-edge technology, and to stay ahead of the competitive software engineering industry by delivering high quality products faster?

Continue reading “Time to Up Your Node.js Skills”

MongoUI: Real-Time MongoDB Admin Web Interface (a la phpMyAdmin in Node.js)

MongoUI is a real-time web interface for Node.js and MongoDB written with DerbyJS—a real-time full-stack web framework. It’s a app that can be run locally and on the server. Similarly, you can view and manipulate data in a local or remote database. The MongoUI project is in beta so use caution, and please contribute your feedback.

MongoUI on NPM: https://www.npmjs.org/package/mongoui

MongoUI on GitHub: https://github.com/azat-co/mongoui

MongoUI description (this page): http://webapplog.com/mongoui

MongoUI features include:

  • Switch databases and collections
  • Search by field value (string, number, ObjectId)
  • Save search / filter results as a bookmark (each URL has a query)
  • Edit any fields’ values in a real-time editor
  • Get raw JSON objects

Here’s a one-and-a-half-minute video that shows filtering, editing, and switching collections:

Direct link to the YouTube video: http://youtu.be/l8Rfpow0f9A.

Continue reading “MongoUI: Real-Time MongoDB Admin Web Interface (a la phpMyAdmin in Node.js)”