devlogbook.comCreate a Basic Framework with Express (Part 3)We need to show error pages to users, ie: 404, 500, 400 Create the views views/layouts/main.hbs <html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equi...Aug 27, 2023·2 min read
devlogbook.comCreate a Basic Framework with Express (Part 2)In this part 2, we will define routes while incorporating Handlebars. Installing Handlebars Install express-handlebars with the command npm install express-handlebars Require express-handlebars in index.js ... const app = express() const handl...May 1, 2023·2 min read
devlogbook.comCreate a Basic Framework with Express (Part 1.1)In Part 1, error handling was created. Let's make it easier to throw errors. Instead of let error = new Error('This is a major issue!!') error.statusCode = 500 throw error We will make it something like this throw new ServerError({ message: 'This is...Apr 2, 2023·1 min read
devlogbook.comCreate a Basic Framework with Express (Part 1)We will be using Docker, Node 18, MySQL 8, and Redis. Following Setting Up Node App using Docker post express, nodemon, dotenv packages should be installed. In this application, we will not be writing a rest app, it will be a basic full stack framewo...Mar 20, 2023·3 min read
devlogbook.comSetting Up Node App using DockerCreate a docker setup to build a Node Express app with MySQL and Redis Create a directory and go switch to it mkdir nodeapp cd nodeapp Create package.json To avoid installing Node locally, we will use this docker command to npm init docker run...Jan 16, 2023·3 min read