Mindblown: a blog about philosophy.

  • How to Use Environment Variables in Bun JS

    Bun JS, like all other server side tech, comes with the ability to read your environment variables. Environment variable files are read in a particular order though: Note that in item 2 (prod / dev / test) bun will first read the current environment variable -> NODE_ENV, to decide which one to select. You can…

  • Express Server with Email Password Auth

    Introduction The FIRST thing you do with any app is to create authentication for it, after all you will have users and they will need accounts! In this article I will show you the basic idea with a standalone one file express server. We will use several popular off the shelf libraries such as express…

  • How to Create an Express JS Server

    Creating a basic server in Express.js is very straightforward. Express.js is a minimal and flexible Node.js web application framework that provides a robust set of features to develop web and mobile applications. To create a basic server, follow these steps: Your server will start, and you should see the message “Server is running at http://localhost:3000”…

  • How to Add NPM Packages in Bun JS

    Bun JS has an insanely fast package installer which is one great reason to upgrade to it over Node! To install a package in bun simply use: For example, install figlet (ASCII art) and its typings:

  • Hot Reload / Watch Code Changes in Bun JS

    Bun incudes 2 very handy flags that will watch your project for file changes. 1. –watchThis is used in the command to run your server, eg: If a files contents change within your project folder then bun will cold reload your project – equivalent to restarting the server. All states and connections will be destroyed.…

  • How to Create a Server in Bun JS

    Note that these instructions are for installing on Mac. Linux or WSL on Windows. Native Windows is experimental at this point (2023) so best to avoid it for now. Open up a folder in VS Code where your project will live. Open up a terminal within VS Code and enter: This will install bun for…

  • Create a Basic Express JS Server

    This server will print out a “hello world” to a local webpage on your PC. The steps are simple: Step 1: Install Node JS Go here https://nodejs.org/en/download/ and download the installer for your system (Max / Windows / Linux). Once installed verify by opening a cmd or terminal and typing “node -v && npm -v”…

Got any book recommendations?