Comparing version 0.3.1 to 0.4.0
@@ -15,9 +15,13 @@ 'use strict'; | ||
function create(options) { | ||
var verbose = options.verbose; | ||
var prefixes = options.prefixes; | ||
var index = options.index || 'core'; // without leading slash | ||
return function (request, response, next) { | ||
if ('GET' != request.method && 'HEAD' != request.method) { | ||
return next(); | ||
} | ||
var pathname = url.parse(request.url).pathname, | ||
@@ -37,3 +41,3 @@ filename, | ||
pathname = pathname.replace(/^\/v=[^\/]+\//, '/'); | ||
pathname = pathname.replace(/^\/$/, '/core'); | ||
pathname = pathname.replace(/^\/$/, '/' + index); | ||
filename = prefixes.map(function (p) { | ||
@@ -51,3 +55,3 @@ return path.join(p, pathname); | ||
var stream = fs.createReadStream(filename); | ||
if (pathname === '/core' || pathname === '/signin') { | ||
if (pathname === '/ui' || pathname === '/core' || pathname === '/signin') { | ||
type = 'text/html'; | ||
@@ -54,0 +58,0 @@ var replaceVersion = require('../replace_version').createReplaceStream(prefixes); |
{ | ||
"name": "appserver", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"description": "A connect based middleware to support local development against a remote backend.", | ||
@@ -5,0 +5,0 @@ "main": "./lib/appserver", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41837
774