Socket
Book a DemoInstallSign in
Socket

@oada/formats-server

Package Overview
Dependencies
Maintainers
8
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@oada/formats-server

OADA formats server plugins

latest
Source
npmnpm
Version
4.0.0
Version published
Maintainers
8
Created
Source

@OADA/formats-server

This package is a library for handling OADA formats in HTTP servers (currently supports express and fastify).

Installation

yarn add @oada/formats-server

Usage

It will set relevant HTTP headers for known OADA formats. If it encounters an unknown format, it leaves the headers alone.

Express

// Import the middleware version
import { middleware: formats } from '@oada/formats-server';

// Must be `use`d _after_ the `Content-Type` is set to work properly
app.use(formats())

Fastify

// Import the fastify plugin
import { plugin: formats } from '@oada/formats-server';

fastify.register(formats)

Keywords

oada

FAQs

Package last updated on 05 Apr 2024

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