Open sourceActive

Express.js

Minimal and flexible Node.js web application framework with built-in error handling.

Open source page ↗

Field note

What it does

Express catches and processes errors from synchronous and asynchronous route handlers and middleware, with a default error handler and support for custom error handlers.

Capabilities

Available capabilities

Tags

Tags

Ways to use it

Ways to use it

npm

JavaScript / express

npm

JavaScript / cassandra-driver

npm

JavaScript / couchbase

npm

JavaScript / nano

npm

JavaScript / express

Product features

Product features

Asynchronous Error Catching

Rejected promises from async handlers call next(value) automatically.

Callback API Error Forwarding

Errors from callback APIs must be passed to next() manually.

Caution

Writing Error Handlers

You can write custom error-handling middleware to process errors.

Default Error Handler

Express comes with a default error handler so you don't need to write your own to get started.

Named parameters

Note

Optional segments

Promise Chain Support

Returning a promise from a handler makes Express call next automatically on rejection.

Regular expressions

Route methods

Route parameters

Route paths

Routing

String paths

Synchronous Error Catching

Errors thrown in synchronous route handlers and middleware are caught and processed by Express.

Warning

Wildcards