Socket
Socket
Sign inDemoInstall

dummy-static-middleware

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    dummy-static-middleware

Dummy static middleware for expressjs


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Install size
1.97 kB
Created
Weekly downloads
 

Readme

Source

Dummy static middleware for expressjs

which prevents annoying 'not found' errors at development environment.

Installation


npm install dummy-static-middleware

Usage


app.use(express.static('static/'));
app.use(require('dummy-static-middleware')([
	{url: /\.(jpeg|jpg|JPG|png|gif)$/, reply: 'static/images/dummy404.png'},
	{url: '/some.txt', reply: 'static/dummy.txt'}
]));

url could be regular expression or string for exact matching, reply is path to file which content will be sent in the response.

Keywords

FAQs

Last updated on 22 Apr 2013

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