Categories
JavaScript Answers

How to use app.configure in with Node.js Express?

Spread the love

To use app.configure in with Node.js Express, we call app.use.

For instance, we write

const express = require("express");
const app = express();

app.use(/*****/);
app.use(/*****/);

app.get("/", (req, res) => {
  //...
});

to call app.use to load middlewares before we call app.get to add a get route handler.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *