Express

Security Best Practices for Using Express Apps in Production

When we use an Express app for production, i.e. it’s used by external users, we have to be careful about security since it’s available to the outside world. In this article, we’ll look at some security best practices when running Express apps in a production environment. Don’t Use Outdated Versions of Express Outdated versions of

Security Best Practices for Using Express Apps in Production Read More »

Use body-parser Express Middleware to Parse Text and URL-Encoded Requests

By default, Express 4.x or later doesn’t come with anything to parse request bodies. Therefore, we need to add something to do this. In this article, we’ll look at how to use the body-parser middleware to do this with text and URL-encoded request bodies. Parsing Text Bodies We can parse text request bodies with the

Use body-parser Express Middleware to Parse Text and URL-Encoded Requests Read More »

Guide to the Express Router Object — Request and Parameter Handling

The Expressrouter object is a collection of middlewares and routes. It a mini-app within the main app. It can only perform middleware and routing functions and can’t stand on its own. It also behaves like middleware itself, so we can use it with app.use or as an argument to another route’s use method. In this

Guide to the Express Router Object — Request and Parameter Handling Read More »

Guide to the Express Router Object — Multiple Requests and Middleware

The Expressrouter object is a collection of middlewares and routes. It a mini-app within the main app. It can only perform middleware and routing functions and can’t stand on its own. It also behaves like middleware itself, so we can use it with app.use or as an argument to another route’s use method. In this

Guide to the Express Router Object — Multiple Requests and Middleware Read More »

Guide to the Express Application Object — Rendering and Setting

The core part of an Express app is the Application object. It’s the application itself. In this article, we’ll look at the methods of the app object and what we can do with it, including rendering HTML and changing settings. app.render(view, [locals], callback) We can use the app.render method to render HTML of a view

Guide to the Express Application Object — Rendering and Setting Read More »