node.js

A 12-post collection

Keep Calm, and Keep Coding with Cosmos and Node.js

Coding with the Cosmos DB SDK feels good. Yes, I said feels good. Yeah, yeah … it is fast to install, fast to learn and fast to execute. But most of all it feels good. Think about when you are coding and everything is just flowing for you. It feels great to be in a rhythm and get everything out of your head and into the code and working fluidly! A key ingredient to this is when the APIs we are coding are intuitive and easy to follow. This is where the Cosmos DB SDK shines brightest. Let's see why. I Want to Have Fun with the Code Now Cosmos DB SDK is awesome, feels great, and if you want to...


Debug Your Node.js App in 60 Seconds

Setting up debugging can be a chore. It can make you feel like console.log isn't so bad after all. Right? While I enjoy a good console.log as much as anyone, I'd much rather debug with zero configuration of my app. Wouldn't you? Visual Studio Code (aka VS Code) has changed the game on Node.js debugging. There is a feature called Node: Auto Attach (you can learn more about it here in the docs). Or keep reading - this will only take a minute. When you enable this feature, you can run your node app from a command line, from an npm script, or from a tool that runs one of those. Just make sure you add the...


Node.js Everywhere with Environment Variables

You build your Node.js apps to work first and foremost on your computer. You know it’s important that apps also work everywhere they need to run. This could be on your colleagues’ computers, internal company servers, cloud servers, or inside of a container (maybe using Docker). Enter environment variables. I have been a closet sketch-noter for a while now. I decided to start sharing them more. You can see the sketch-note I created for this post, as an illustrated guide to using environment variables. Environment variables are a fundamental part of developing with Node.js, allowing your app to behave differently based on the environment you want them to run in. Wherever your app needs configuration, you use...


Pushing Node.js to Azure While You Make Your Coffee

Many of us enjoy our coffee in the morning ... or late afternoon ... or whenever we can get a dose of "wake me up". It takes just a few minutes. But those are also precious minutes away from the keyboard where I feel most productive. Often I run a process when I go to make my coffee, but so many take so long that it is nice when I can get something done in just a few seconds or minutes. I've been using this relatively new command for Azure called az webapp up. It pushes my node.js apps up to Azure without asking me a ton of questions. Run it in a folder and give it a name...


Run Node with Docker in 5 Minutes

Heard of the latest and greatest thing? Of course. It's everywhere. Been avoiding it? Ugh, maybe if we just pretend it doesn't exist, this fad will disappear before we need to learn it. Do you ever feel this way? I think it affects a lot of people in our technical community. What if the time investment was just a few minutes, you could learn the basics of the "new thing", and have something running? Just a little taste of success to at least say we've tried it? Sometimes that is all it takes to get started. Let's give this a go with Docker and see if it can take us less than 5 minutes to find success. Here...