Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

middleman-middleware

0.0.2 • Public • Published

NPM Version

Middleman Middleware

This middleware will create a mirror of a given URL response and inject given CSS and JS into the response.

This can be used with express or any other accepting HTTP server

Installation

npm install middleman-middleware

Example Usage with Express:

var express = require('express');
var middlemanMiddleware = require('middleman-middleware');
 
var app = express();
 
app.use(middlemanMiddleware({
  url: 'http://www.reddit.com',
  css: 'body{background-color: red;}',
  js: 'alert("hi reddit");'
}));
 
app.listen(3000);

Keywords

none

install

npm i middleman-middleware

Downloadsweekly downloads

10

version

0.0.2

license

MIT

last publish

collaborators

  • avatar
Report a vulnerability