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

broker

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

broker

Express/Connect middleware that serves local or remote static files

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

broker

Express/Connect middleware that serves local or remote static files.

Install

npm install broker --save

Usage

Serve static files

var express = require('express');
var broker = require('broker');

var app = express();

app.use(broker({
  root: '/public'
}));

app.listen(3000, function () {

});

Proxy remote files

var express = require('express');
var broker = require('broker');

var app = express();

app.use(broker({
  root: 'http://proxyserver.com'
}));

app.listen(3000, function () {

});

broker([options])

  • options - the options are similar to the send module because it uses this to serve local static files. Here are a few:
    • root - the root directory if serving local files or the url to prepend to requests to proxy remote static files
    • index - a string or array of strings that define the directory index file
    • dotfiles - how to handle files that begin with a dot. These are usually hidden files. The default value is ignore. Available options:
      • allow - No special treatment for dotfiles
      • deny - Send a 403 for any request for a dotfile
      • ignore - Pretend like the dotfile does not exist and 404

Run Tests

npm install
npm test

Keywords

FAQs

Package last updated on 17 Sep 2014

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