Skip to content

Commit

Permalink
Merge 33d8675 into fa9c21b
Browse files Browse the repository at this point in the history
  • Loading branch information
sweatercomeback committed Sep 23, 2019
2 parents fa9c21b + 33d8675 commit ab64f93
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/miniprofiler.js
Expand Up @@ -17,10 +17,11 @@
var clientParser = require('./client-parser.js');

const hostname = require('os').hostname;
var ignoredPaths = [];
var ignoredPaths = [];
var trivialDurationThresholdMilliseconds = 2.5;
var popupShowTimeWithChildren = false;
var popupRenderPosition = 'left';
var resourcePath = '/mini-profiler-resources/';

exports.storage = {
InMemoryStorage: require('./storages/inmemory.js'),
Expand All @@ -47,7 +48,6 @@ for (let framework of ['koa', 'express', 'hapi']) {
exports[framework].for = func.buildMiddleware;
}

var resourcePath = '/mini-profiler-resources/';
var version = require('../package.json').version;

var contentTypes = {
Expand Down Expand Up @@ -218,6 +218,7 @@ function include(id) {
* - trivialDurationThresholdMilliseconds: double ; any step lasting longer than this will be considered trivial, and hidden by default
* - popupShowTimeWithChildren: boolean ; whether or not to include the "time with children" column
* - popupRenderPosition: 'left', 'right', 'bottomLeft', 'bottomRight' ; which side of the screen to display timings on
* - resourcePath: string ; if your site root is in a subdirectory, specify here, e.g., /siteroot
*/
function configure(options){
options = options || {};
Expand All @@ -227,6 +228,7 @@ function include(id) {
popupShowTimeWithChildren = options.popupShowTimeWithChildren || popupShowTimeWithChildren;
popupRenderPosition = options.popupRenderPosition || popupRenderPosition;
storage = options.storage || storage;
resourcePath = `${options.resourcePath || ''}/${resourcePath}`;
}

/*
Expand Down

0 comments on commit ab64f93

Please sign in to comment.