Socket
Socket
Sign inDemoInstall

@types/restify-cors-middleware

Package Overview
Dependencies
6
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/restify-cors-middleware

TypeScript definitions for restify-cors-middleware


Version published
Weekly downloads
1.2K
decreased by-17.46%
Maintainers
1
Install size
3.90 MB
Created
Weekly downloads
 

Readme

Source

Installation

npm install --save @types/restify-cors-middleware

Summary

This package contains type definitions for restify-cors-middleware (https://github.com/TabDigital/restify-cors-middleware).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/restify-cors-middleware.

index.d.ts

/// <reference types="node" />

import { RequestHandler } from "restify";

declare namespace corsMiddleware {
    interface Options {
        /**
         * an array of whitelisted origins
         * can be both strings and regular expressions
         */
        origins: Array<string | RegExp>;
        /** user defined headers to allow */
        allowHeaders: string[];
        /** user defined headers to expose */
        exposeHeaders: string[];
        /** if true, uses creds */
        credentials?: boolean | undefined;
        /** ms to cache preflight requests */
        preflightMaxAge?: number | undefined;
        /** customize preflight request handling */
        preflightStrategy?: any;
    }

    interface CorsMiddleware {
        actual: RequestHandler;
        preflight: RequestHandler;
    }
}

declare function corsMiddleware(options: corsMiddleware.Options): corsMiddleware.CorsMiddleware;
export = corsMiddleware;

Additional Details

Credits

These definitions were written by Daniel Thunell.

FAQs

Last updated on 07 Nov 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc