Express tutorials

Building Email Verification System Using Node and Redis

Node.js and Redis are a very powerful combination to yield a high-performance result. In the previous tutorial, we have covered the installation and useful Redis commands. In this tutorial, we will take one step ahead and build a useful real-time application. We have already covered Redis as session store in one of our tutorial. If …

Building Email Verification System Using Node and Redis Read More »

Serving Static Files in Express Framework

Express provides built-in middleware that allows us to serve static files directly from the file system. express.static() is the middleware that we can use to serve static files to the user. Here is the simple example code: const express = require(’express); const router = express.Router(); const app = express(); app.use(express.static(‘public’)); app.use(‘/’, router); app.listen(3000); Assuming you …

Serving Static Files in Express Framework Read More »

Using Express res.sendFile() Function to Serve Files

You can send files directly from the Express router using res.sendFile() method. You can send a file of any type such as HTML, PDF, Multimedia, etc. res.sendFile() Method Express provides a method in the response object of the router called sendFile() that can be used to serve static files. res.sendFile() method accepts absolute paths only. …

Using Express res.sendFile() Function to Serve Files Read More »

Send a JSON response using Express Framework

Generally, we use res.send() method to send response to the API call. Here is the sample code. const express = require(’express); const router = express.Router(); const app = express(); router.get(‘/api’, (req,res) => {     res.send(‘Hello World’); }); app.use(‘/’, router); app.listen(3000); You can send the JSON response by using res.json() method. It accepts an object …

Send a JSON response using Express Framework Read More »

Build a Weather Web App Using Node Express and WeatherStack

Weather app is very common among people. It’s on our phone screen, on our computer’s menu bar. Let’s build one in order to understand how to integrate third-party APIs into our web application. In this article, we will build a simple application that will take the city name as an input and returns its current …

Build a Weather Web App Using Node Express and WeatherStack Read More »

Facebook Login Implementation Using Nodejs and Express

Facebook Login is widely used as an authentication module on websites. Instead of asking user manual details such as email and password and then verify them, it’s better to use already verified user details. In this article, we are going to learn and implement a Facebook Login System using Nodejs and ExpressJS. You can download …

Facebook Login Implementation Using Nodejs and Express Read More »

Session Management in Nodejs Using Redis as Session Store

We have covered session management in ExpressJs using a global variable technique which of course will not work in the case of shared server or concurrent execution of HTTP requests which is the most familiar production scenario. Codeforgeek readers requested to provide a solution for this issue and the optimal one is to use external …

Session Management in Nodejs Using Redis as Session Store Read More »