Installation


Get started with ds-express-errors in seconds.

Install via NPM

npm install ds-express-errors

Current latest version:NPM Version

Basic Setup

Integrate the global error handler into your Express application.

important icon

Important

The errorHandler middleware must be defined last, after all other routes and middleware.


javascript

import express from 'express'
import { errorHandler } from 'ds-express-errors'

const app = express();

// ... define your routes here ...

// Add Error Handler at the very end
app.use(errorHandler);

app.listen(3000, () => {
  console.log('Server is running');
});