Skip to content
Express middleware to dynamically resize images based on Imagina Library
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
.gitignore
LICENSE
README.md
package.json

README.md

imagina-middleware

Express middleware to dynamically resize images based on Imagina Library.

Examples

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

var app = express();

app.configure(function() {
  var conf = {
    root: path.join(__dirname, 'public/imgs'),
    resolutions: ['800x600', '1024x768']
  };
  app.use('/imgs/', require('imagina-middleware')(conf));
  app.use(express.static(path.join(__dirname, 'public')));
});

app.listen(8080);
var express = require('express');
var path = require('path');

var app = express();

app.configure(function() {
  var conf = {
    root: path.join(__dirname, 'public/imgs')
  };
  app.use('/imgs/', require('imagina-middleware')(conf));
  app.use(express.static(path.join(__dirname, 'public')));
});

app.listen(8080);
var express = require('express');
var path = require('path');

var app = express();

app.configure(function() {
  var conf = {
    imagina: { workers: 3 },
    root: path.join(__dirname, 'public/imgs')
  };
  app.use('/imgs/', require('imagina-middleware')(conf));
  app.use(express.static(path.join(__dirname, 'public')));
});

app.listen(8080);
var express = require('express');
var path = require('path');
var Imagina = require('imagina');

var app = express();

app.configure(function() {
  var im = new Imagina();

  var conf = {
    imagina: im,
    root: path.join(__dirname, 'user-files/imgs')
  };
  app.use('/user-imgs/', require('imagina-middleware')(conf));
  app.use('/user-imgs/', express.static(path.join(__dirname, 'user-files')));

  var conf = {
    imagina: im,
    root: path.join(__dirname, 'system-files/imgs')
  };
  app.use('/system-imgs/', require('imagina-middleware')(conf));
  app.use('/system-imgs/', express.static(path.join(__dirname, 'system-files')));
});

app.listen(8080);
Something went wrong with that request. Please try again.