VOOZH about

URL: https://www.geeksforgeeks.org/web-tech/express-js-app-delete-function/

⇱ Express app.delete() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Express app.delete() Function

Last Updated : 15 Jul, 2025

The `app.delete()` function is utilized to handle HTTP DELETE requests for a specified path. It takes the path as a parameter and also accepts callback functions as parameters to handle the request.

Syntax:

app.delete(path, callback)

Parameters:

  • path: It is the path for which the middleware function is being called.
  • callback: It is a middleware function or a series/array of middleware functions. 

app.delete() function is basically used to handle DELETE requests in Express.js.

Steps to Install the express module:

Step 1: You can install this package by using this command.

npm install express

Step 2: After installing the express module, you can check your express version in the command prompt using the command.

npm version express

Step 3: After that, you can just create a folder and add a file, for example, index.js. To run this file you need to run the following command.

node index.js

Project Structure:

👁 NodeProj

The updated dependencies in package.json file will look like:

"dependencies": {
"express": "^4.18.2",
}

Example: Below is the example of the app.delete() Function:

Steps to run the program:

node index.js

Console Output:

Server listening on PORT 3000

Browser Output: Now make a DELETE request to http://localhost:3000/ and you will get the following output: 

DELETE Request Called 

We have a complete list of all the important Express Application Module methods, to check those please go through Express Application Complete Reference article

Comment