@oada/formats-server
TypeScript icon, indicating that this package has built-in type declarations

4.0.0 • Public • Published

@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)

Package Sidebar

Install

npm i @oada/formats-server

Weekly Downloads

32

Version

4.0.0

License

MIT

Unpacked Size

13.1 kB

Total Files

20

Last publish

Collaborators

  • sanoel
  • serviopalacios
  • aultac
  • awlayton
  • oadao
  • tarakawa
  • cyrusbowman
  • abalmos