🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

dummy-static-middleware

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dummy-static-middleware

Dummy static middleware for expressjs

0.1.0
latest
Source
npm
Version published
Weekly downloads
2
-66.67%
Maintainers
1
Weekly downloads
 
Created
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

express

FAQs

Package last updated on 22 Apr 2013

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