Express Module Methods

Beginner
6 min read
Updated: Nov 2026
4 method guides
Method index

About This Index

This page is the express() module index for the tutorial track. Each row links to a full guide with syntax, examples, and FAQs.

Call express() to create an app, then mount built-in helpers from the same module: express.json(), express.urlencoded(), express.static(), and express.Router(). Application methods live under /express/app.

Beginner path.

Start with const app = express(), add express.json(), then express.static()—open express.Router() when you split routes into modules.

How to Call express() Module APIs

Import the module once, create the app, then mount the built-in factories you need:

Express
const express = require("express");
const path = require("path");

const app = express();
const api = express.Router();

app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use(express.static(path.join(__dirname, "public")));

api.get("/health", (req, res) => {
  res.json({ ok: true });
});

app.use("/api", api);

app.listen(3000);

Express Module Methods Table

All express() module guides in this Express.js tutorial series (4 tutorials).

Body Parsers

2 methods

Turn request bodies into req.body — JSON APIs and HTML forms.

MethodDescriptionTutorial
express.json()Parse JSON request bodies into req.body — the default body parser for APIs.Try it
express.urlencoded()Parse URL-encoded form bodies (application/x-www-form-urlencoded) into req.body.Try it

Static Files

1 method

Serve public assets without writing a route for every file.

MethodDescriptionTutorial
express.static()Serve static files from a folder — CSS, images, client JS, and uploads.Try it

Router Factory

1 method

Split routes into express.Router() modules and mount them on the app.

MethodDescriptionTutorial
express.Router()Create a modular mini-app router — mount route groups with app.use().Try it

Frequently Asked Questions

After const express = require('express'), you get express() to create an app, plus helpers like express.json(), express.urlencoded(), express.static(), and express.Router().
It returns the Application instance (app) you use to register middleware, routes, settings, and app.listen().
Use express.json() for JSON APIs (Content-Type: application/json). Use express.urlencoded() for HTML form posts (application/x-www-form-urlencoded). Many apps mount both.
express.Router() creates a modular routing stack you mount with app.use('/path', router). Prefer routers as your Express tutorial projects grow beyond a single file.
Create the app with express(), then add express.json() (and often express.static()). Open express.Router() when you split routes into modules.

Start with express.json()

Open the JSON body-parser guide—syntax, options, and FAQs.

express.json() tutorial →

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.

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

16 people found this page helpful