🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

b2g-scripts

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

b2g-scripts - npm Package Compare versions

Comparing version

to
0.4.0

2

package.json
{
"name": "b2g-scripts",
"version": "0.3.0",
"version": "0.4.0",
"author": "James Lal <jlal@mozilla.com>",

@@ -5,0 +5,0 @@ "description": "B2G/Gaia Helper Scripts",

@@ -19,2 +19,7 @@ var Server = require('../lib/script')({

forward: {
alias: 'f',
desc: 'Forward all paths without extension to index.html'
},
port: {

@@ -77,15 +82,20 @@ alias: 'p',

var HAS_EXTENSION = /\.[a-zA-Z9-9]+(\?(.*))?$/
var SHARED = /^\/?shared/
require('http').createServer(function (request, response) {
request.addListener('end', function () {
var host = request.headers.host,
app = host.split('.')[0];
var host = request.headers.host;
var app = host.split('.')[0];
if(apps[app]) {
if(apps[app] && !SHARED.test(request.url)) {
var url;
if(argv.forward && !HAS_EXTENSION.test(request.url)) {
request.url = fsPath.join('/' + apps[app], app, 'index.html');
} else {
request.url = fsPath.join('/' + apps[app], app, request.url);
file.serve(
request, response
);
} else {
file.serve(request, response);
}
}
file.serve(request, response);
});

@@ -92,0 +102,0 @@ }).listen(port);