Express Application Methods

About This Index
This page is the Express Application index for the tutorial track. Each row links to a full guide with syntax, examples, and FAQs.
Learn the Express overview on /express. Use this page when you need an Application API such as app.use(), app.get(), or app.listen().
Start with app.use() and app.get(), then app.listen()—add app.set() and app.route() when you need views or multi-method paths.
How to Call an Application Method
Create an app with express(), then configure middleware, routes, and listen:
const express = require("express");
const app = express();
app.use(express.json());
app.set("view engine", "ejs");
app.get("/", (req, res) => {
res.send("Hello Express");
});
app.post("/users", (req, res) => {
res.status(201).json(req.body);
});
app.route("/items")
.get((req, res) => res.json([]))
.post((req, res) => res.sendStatus(201));
app.listen(3000, () => {
console.log("listening on :3000");
}); Express Application Methods Table
All Application method guides in this Express.js tutorial series (23 tutorials).
Getting Started
2 methodsWire middleware and start the HTTP server — every Express tutorial begins here.
| Method | Description | Tutorial |
|---|---|---|
app.use() | Mount middleware or a sub-app at a path — the foundation of every Express pipeline. | Try it |
app.listen() | Bind the app to a port and start accepting HTTP connections. | Try it |
HTTP Routing
8 methodsDefine routes by method and path — get, post, put, delete, all, METHOD, and route().
| Method | Description | Tutorial |
|---|---|---|
app.get() | Register a GET route, or read an application setting when called with one argument. | Try it |
app.post() | Register a POST route handler for form and API submissions. | Try it |
app.put() | Register a PUT route handler for full resource updates. | Try it |
app.query() | Register a QUERY route — search with a request body instead of a long URL. | Try it |
app.delete() | Register a DELETE route handler for removing resources. | Try it |
app.all() | Match a path for every HTTP method — useful for shared middleware on a route. | Try it |
app.METHOD() | Register a route for any HTTP verb Express supports (get, post, put, patch, …). | Try it |
app.route() | Create a chainable route for one path — attach .get(), .post(), and more in one place. | Try it |
Settings & Views
8 methodsConfigure the app — settings flags, template engines, and locals.
| Method | Description | Tutorial |
|---|---|---|
app.set() | Assign an application setting such as view engine, views folder, or env. | Try it |
app.enable() | Set a boolean setting to true — shorthand for app.set(name, true). | Try it |
app.disable() | Set a boolean setting to false — shorthand for app.set(name, false). | Try it |
app.enabled() | Return true if a boolean setting is enabled. | Try it |
app.disabled() | Return true if a boolean setting is disabled. | Try it |
app.engine() | Register a template engine callback for a file extension. | Try it |
app.locals | Application-level local variables available to all templates. | Try it |
app.render() | Render a view to a string callback — useful outside of a request/response cycle. | Try it |
Params
1 methodRun logic when named route parameters appear in the URL.
| Method | Description | Tutorial |
|---|---|---|
app.param() | Register callback middleware that runs when a route parameter is present. | Try it |
Mounting & Modular Apps
4 methodsMount sub-apps and routers — path(), mountpath, and Router overview.
| Method | Description | Tutorial |
|---|---|---|
app.path() | Return the mount path of this app when used as a sub-app. | Try it |
app.mountpath | The path pattern where this app is mounted — string or array of patterns. | Try it |
app.mountpath (deep dive) | Detailed guide to mountpath values, multi-path mounts, and vs req.baseUrl. | Try it |
Router overview | Use express.Router() mini-apps and mount them with app.use() for modular routes. | Try it |
Frequently Asked Questions
Start with app.use()
Open the middleware guide—syntax, examples, and FAQs.
CODETOFUN NEWS
Stay Ahead in Tech
Get the latest IT news, programming updates, and technology trends directly on your phone.
Your daily dose of tech, straight to your feed.
16 people found this page helpful
