• Using GraphQL with Express.js

    How to use GraphQL with Express.js This article is for developers who are familar with Express, but has little to no experience with GraphQL. I will give a high-level introduction to GraphQL and some...

  • vhost in Express.js

    Wondering how to replicate the Apache vhost feature in Express.js? In case you are new to vhost, it allows a web server to listen on a single port and serve different web apps depending on the domain...

  • Express.js: Writing middleware

    How to write Express.js middleware First, let's understand what an Express middleware is. An Express middleware is a function which is allowed to be a part of Express's request-response cycle. This f...

  • JavaScript: Get browser window width and height

    The dimensions of the browser window can be determined using the followng width-height properties of the window object: window.innerWidth, window.innerHeight, window.outerWidth, and window.outerHeig...

  • Disabling the context menu using JavaScript

    How to disable the browser rightclick menu One may want to disable the right click context menu on a webpage for various reason. It could be to show a custom context menu or to prevent images from be...

  • JavaScript: Get screen width and height (resolution)

    The screen resolution of a device can be determined using the screen object. screen.width returns the width of the screen, while screen.height returns the height of the screen.

  • Why the names btoa and atob for Base64 encoder decoder functions?

    Why are they named btoa() and atob()? If you have ever needed to encode text to Base64 or decode a Base64 encoded string to plain text, you should be familiar with the methods btoa() and atob(). Thei...