Skip to content

Latest commit

 

History

History
43 lines (30 loc) · 1.09 KB

README.md

File metadata and controls

43 lines (30 loc) · 1.09 KB

@deanrih/elysia-problem-details

NOTE: The package/library still in progress of being extracted from my work project

An ElysiaJS middleware implementation for Problem Details (RFC 9457).

Installation

NOTE: The package/library hasn't been actually published yet, these commands are placeholder

# Bun
bun add @deanrih/elysia-problem-details
# pnpm
pnpm add @deanrih/elysia-problem-details
# npm
npm install @deanrih/elysia-problem-details

Usage

NOTE: The package/library hasn't been actually published yet, this example is a placeholder

import { Elysia } from "elysia";
import { problemDetails } from "@deanrih/elysia-problem-details";

const app = new Elysia()
  .use(problemDetails())
  .get("/", () => new Error())
  .listen(3000, (server) => {
    console.clear();
    console.log(`Listening @ ${server.hostname}:${server.port}`);
  });

Checkout the example folder.

Credits/Reference

IETF RFC Datatracker