Articles
IoT Current consumption monitoring system
When you don't know how much power your air conditioner draws, it's easy to leave it running without feeling too guilty. And then the electricity bill comes...
This very application, a CMS based on Neo4J
Publishing articles on a website can be as simple as uploading HTML files to a web server. However, writing articles in raw HTML can be time consuming. A content management system (CMS) is an application designed to solve this issue by providing a simple way to create and manage web content directly from the web browser. There are many CMSs available, namely Wordpress or Joomla but I decided to create my own as a form of practice and in order to have it highly customized to my needs.
Mongoose bulkWrite upsert
Here is a code snippet for a bulk update with upsert using Mongoose:
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>.
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>.
Puppeteer setup for NodeJS
Puppeteer is a headless browser with which NodeJS can interact to automate web pages manipulation.
Testing in NodeJS with Mocha
Mocha is a popular testing framework for NodeJS. it can be installed using npm:
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:
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: