Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

express-rdf-problem-details

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-rdf-problem-details

hydra-box error handler which returns HTTP Problem Details with JSON-LD context link

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

express-rdf-problem-details

This package wraps express-http-problem-details so that RDF/Linked Data express applications will return Problem documents (RFC7807) as valid JSON-LD.

This is done simply by adding a Link header pointing to a JSON-LD @context. By default, it's the context provided by Hydra Community Group

Usage

import express from 'express'
import * as error from 'express-rdf-problem-details'
import { NotFoundMapper } from './error-mappers'

const app = express()

// All params optional
express.use(error.handler({
  // change the @context URL
  context: 'http://example.com/error.jsonld',
  // additional mappers to customize error documents
  mappers: [new NotFoundMapper()] 
}))

Implementing mappers is explained in PDMLab/express-http-problem-details

FAQs

Package last updated on 01 Nov 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc