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

exports.registerHandlers = function(application, params) {
  params = params || {};

  var prefix = params.prefix || '';
  prefix = prefix.replace(/\/$/, '');

  application.set('views', path.join(__dirname, '..', 'views'));
  application.set('view engine', 'ejs');
  application.use(express.favicon());
  application.use(express.logger('dev'));
  application.use(express.bodyParser());
  application.use(express.static(path.join(__dirname, '..', 'public')));

  application.get(prefix + '/dashboard', function(request, response) {
    response.render('index', { title: '', prefix: prefix });
  });
}

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

exports.registerHandlers = function(application, params) {
  params = params || {};

  var prefix = params.prefix || '';
  prefix = prefix.replace(/\/$/, '');

  application.set('views', path.join(__dirname, '..', 'views'));
  application.set('view engine', 'ejs');
  application.use(express.favicon());
  application.use(express.logger('dev'));
  application.use(express.bodyParser());
  application.use(prefix, express.static(path.join(__dirname, '..', 'public')));

  application.get(prefix + '/dashboard', function(request, response) {
    response.render('index', { title: '', prefix: prefix });
  });
}

Apply prefix for static files too
Apply prefix for static files too
