Articles

Node.js

Node.js testing for multiple environment variables

Node.js testing for multiple environment variables thumbnail
Some applications might require the same codebase to be tested with different sets of environment variables. This article proposes a simple way to do so.
Node.jsDevOpsTutorials

NodeJS modules

A JavaScript file can be imported as a module into another file using the <code>require</code> command. For example, he file myPackage.js can be imported as so:
TutorialsNode.js

connect-history-api-fallback ignore certain routes

For example, if the route /file needs to be handled by express and not the single page application:
Node.js

Puppeteer setup for NodeJS

Puppeteer is a headless browser with which NodeJS can interact to automate web pages manipulation.
TutorialsNode.jsPuppeteer

NodeJS app dockerization

NodeJS apps can be containerized using the <code>docker build</code> command. This article is based on <a href="https://nodejs.org/de/docs/guides/nodejs-docker-webapp/" rel="noopener noreferrer nofollow">this guide</a>.
Node.jsDockerTutorialsDevOps

Express authorization middleware

Many applications require some form of authorization mechanism to prevent users from accessing restricted content. Authenticated users are commonly in possession of a cookie containing identification data. With the authentication microservice that I designed, this cookie contains a JWT that contains the user's username. This JWT is sent in the authorization header of HTTP requests. Thus, authorization can be performed easily within each application by simply decoding the JWT. To do so, I designed this simple middleware for ExpressJS.
ProjectsSecurityNPMExpressNode.js

Testing in NodeJS with Mocha

Mocha is a popular testing framework for NodeJS. it can be installed using npm:
TestingMochaNode.js

Web based approval system

Web based approval system thumbnail
With the COVID-19 and the introduction of remote work, a many Japanese companies were struggling with the approval of documents, since those needed to be physically stamped with one's personal seal named Hanko. I decided to solve this issue by creating a web application to keep track of approvals
Vue.jsNode.jsProjectsExpress

Publish a module to NPM

This article is based on <a href="https://www.freecodecamp.org/news/how-to-make-a-beautiful-tiny-npm-package-and-publish-it-2881d4307f78/" rel="noopener noreferrer nofollow">this publiation</a>.
TutorialsNode.jsNPM

Mongoose bulkWrite upsert

Here is a code snippet for a bulk update with upsert using Mongoose:
MongoDBMongooseNode.js