Environment Variables in Node.js

27 August 2018

Many web applications have configurable elements to them. For example, if my application communicates with a database, it needs to know certain information (such as the database host, port, password, and so on) to connect to that database.

How should I store the database connection information? I could hard code it into my application's code, but that causes at least two problems.

First, the database credentials would be visible in the codebase, which is a security issue.

Second, it would also reduce the application's flexibility and portability. For example, if I wanted to change my application's host, I'd have to update its codebase with any new database credentials before I could re-deploy it.

Fortunately, you can avoid hard coded config values by using environment variables. Here I'm going to show you how you can use them in Node.js.


Tags: js

A Quick Dirty Primer on HTTP

24 August 2018

If you're a web developer you need to know about the HTTP protocol.

After all, you'll be dealing with it constantly every day.

But what is it exactly and how does it work? Here's a quick intro on the topic that's enough to get you up and running with a better understanding.


Tags: http

CSS Tutorial: Modern Login Form

14 August 2018

In this tutorial I'll show you how I went about designing a login form, including my reasoning for various design choices and the CSS implementations behind them.

We'll start with a simple HTML template and gradually add styles to it.

Here's a Codepen link for the final design: Login form component.


Tags: html css