Skip to content

MapColonies/error-express-handler

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date
Sep 24, 2024
Sep 24, 2024
Dec 31, 2020
Jan 12, 2021
Sep 24, 2024
Sep 24, 2024
Sep 24, 2024
Dec 31, 2020
Dec 31, 2020
Jun 1, 2022
Dec 31, 2020
Sep 24, 2024
Sep 24, 2024
Sep 24, 2024
Oct 13, 2021
Apr 25, 2021
Sep 24, 2024
Sep 24, 2024
Oct 14, 2024
Sep 24, 2024
Sep 24, 2024
Sep 24, 2024

Repository files navigation

error-express-handler

This package exports a middleware for express that handles Error and HttpError(custom package type).

Install

npm install --save @map-colonies/error-express-handler

Usage

import express from 'express';
import { getErrorHandlerMiddleware } from '@map-colonies/error-express-handler';

process.env.NODE_ENV = 'development';

const app = express();

app.use('/meow', fn);

app.use(getErrorHandlerMiddleware());

app.listen(8080, function() {
    console.log('server is up');
});

Flow

Flow of package