

Hit the following Endpoint with a DELETE request Initializing the express and port numberĬonsole.log("DELETE Request Called for /api endpoint")Ĭonsole.log("Server listening on PORT", PORT) After creating the file, use the command " node appDelete.js" to run this code. callback − These are the middleware functions or a series of middleware functions that act like a middleware except that these callbacks can invoke next (route).Ĭreate a file " appDelete.js" and copy the following code snippet.A path can be a string, path pattern, a regular expression, or an array of all these. path − This is the path for which the middleware function is invoked.Syntax app.delete(path, callback, ) Parameters Also I set up a routes folder as a way to keep things a little more organized compared to having everything in the main app.js file.The app.delete() method routes all the HTTP DELETE requests to the specified path with the specified callback functions. I also made a public folder to house a simple static client with express.static. I just created a new folder, made it the current working folder.

The setup process was not all that different from many of my other examples on express. If you are new to express you might want to check out my main post on express. This is not a getting started post on express.js, or any additional skills that are required before hand to get something of value from this. This is a method that is used to define logic that is used to handle http 1.1 delete requests. This is a post on the app.delete method of the app object in express.js. 1 - Express app.delete and what to know before hand This is a express app object method that can be used to define what to do for an http delete request in express. So for today I put together a quick demo that makes use of the app.delete method. Today for my quick morning post on express.js I wanted to start taking a look at some of the other http request methods other than get, and post.
