If you’ve ever tried to introduce a new tool, technology or technique into an existing team, you’ve probably been met with resistance. Chances are, you’ve been told “no.” with no real discussion. It’s a natural reaction for people to not want change. There’s potential risk. There’s learning curves. There’s a lot of emotional attachment to […]
I recently found myself needing to support an unknown URL folder structure with an Express router. The gist of it is that I am serving video files that may or may not be in a sub-folder, from another service. And after some digging, I found there are at least three ways to make this work – most of which involve copy & paste programming.
A few months ago, I stopped writing AJAX-style auto-complete inputs on my web apps. Instead, I started using the HTML5 DataList feature. It’s a pretty simple, and fairly slick way to do auto-complete on an input text box (as long as your list isn’t too long, since all items will be rendered into the HTML […]
A lot of people think that Node has built-in singleton objects with the “require” function. This is far from the truth. The require function only creates a cached module instance that can easily be broken. So, what does it take to build a true singleton in Node.js?
A reader recently sent me an email, asking a question about how to find an item in an array, based on a property / attribute that would match. Meaning, the object instance will be different, but the attribute (such as “id”) will be the same. This person wanted to know if there’s a good way […]
Express is one of the most flexible web hosting libraries I have used in my career. I love how simple it can be, and how it allows you to grow your system as needed. One of the areas that has continued to bother me in my own code, though, is my lack of ability to […]
Call it “code collapse”, “code folding”, “regions” or whatever your editor says it is called… just don’t call it a feature when it does little more than hide the monsters lurking in your code base.
A few months ago (fall of 2015), my 6 year old daughter saw a crochet kit at a bookstore. It was the kind of kit that comes with a crochet hook, yarn and a book of patterns. There’s enough yarn to create two small projects and hopefully get you started with a new hobby. My […]
A WatchMeCode subscriber recently asked a question about error handlers with Node and Express. In his scenario, the subscriber wants to have a series of routers to handle requests to /api. Within these routes, he wants a generalized error handler that will return the error as a JSON document instead of rendering an HTML page […]