Skip to content

Commit

Permalink
Default error handling default to false
Browse files Browse the repository at this point in the history
  • Loading branch information
corrideat committed Jun 2, 2023
1 parent 6b5eaea commit ed5f308
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

Routemate is a JavaScript router with support for various environments such as Node.js, Deno and Cloudflare Workers, with more to come. It is configured similarly to Express.js but uses standard `Request`, `Response`, and `Headers` elements.

[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=Exact-Realty_routemate&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=Exact-Realty_routemate)
[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=Exact-Realty_routemate&metric=vulnerabilities)](https://sonarcloud.io/summary/new_code?id=Exact-Realty_routemate)
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=Exact-Realty_routemate&metric=bugs)](https://sonarcloud.io/summary/new_code?id=Exact-Realty_routemate)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=Exact-Realty_routemate&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=Exact-Realty_routemate)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=Exact-Realty_routemate&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=Exact-Realty_routemate)
![NPM Downloads](https://img.shields.io/npm/dw/@exact-realty/routemate?style=flat-square)

## Installation

You can install Routemate via npm or yarn:
Expand Down
2 changes: 1 addition & 1 deletion src/common/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const isTPHandlerSetupH = <T>(
): args is Parameters<TPHandlerSetupH<T>> =>
args.length === 1 && typeof args[0] === 'function';

const router_ = (handleUnhandledErrors = true) => {
const router_ = (handleUnhandledErrors = false) => {
const requestHandlers: TRoute<TRequestHandler>[] = [];
const errorHandlers: TRoute<TErrorHandler>[] = [];

Expand Down
2 changes: 1 addition & 1 deletion src/common/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Router from './router.js';
import type { TListener, TServer } from './types/index.js';

const server_ = (listener: TListener): TServer => {
const router = Router();
const router = Router(true);

const proxy: TServer = new Proxy<TServer>(router as unknown as TServer, {
get(target, p) {
Expand Down

0 comments on commit ed5f308

Please sign in to comment.