Comparing version 0.0.2 to 0.0.3
@@ -5,2 +5,3 @@ "use strict"; | ||
var fs = require('fs'); | ||
var http = require("http"); | ||
var project_mapper_1 = require('./project-mapper'); | ||
@@ -12,5 +13,6 @@ var logger_1 = require("./logger"); | ||
var _ = require('lodash'); | ||
function getLoaderConfig(server, topology) { | ||
function getLoaderConfig(server, serverConfig) { | ||
var protocol = serverConfig.forceHttp1 ? 'http' : 'https'; | ||
var hostname = server.address().address; | ||
var baseURL = "https://" + (hostname === '::' ? '127.0.0.1' : hostname) + ":" + server.address().port; | ||
var baseURL = protocol + "://" + (hostname === '::' ? '127.0.0.1' : hostname) + ":" + server.address().port; | ||
return { | ||
@@ -20,4 +22,4 @@ baseURL: baseURL, | ||
meta: (_a = {}, | ||
_a[topology.nodeMount.slice(1) + '/*'] = { | ||
deps: [topology.nodeMount + '/' + nodeSupport.globals] | ||
_a[serverConfig.nodeMount.slice(1) + '/*'] = { | ||
deps: [serverConfig.nodeMount + '/' + nodeSupport.globals] | ||
}, | ||
@@ -56,2 +58,3 @@ _a | ||
function serveFile(res, source) { | ||
var _this = this; | ||
getResponseHeaders(source, function (err, responseHeaders) { | ||
@@ -72,2 +75,3 @@ if (err) { | ||
res.end(err.toString()); | ||
_this.end(); | ||
}); | ||
@@ -101,3 +105,4 @@ stream_1.pipe(res); | ||
systemMount: '/$system', | ||
ssl: spdyKeys | ||
ssl: spdyKeys, | ||
forceHttp1: false | ||
}; | ||
@@ -110,3 +115,3 @@ /* TODO: normalize topology (leading/trailing slashes) */ | ||
var projectMap = project_mapper_1.makeSerializable(project_mapper_1.getProjectMap(serverConfig, { nodeLibs: true })); | ||
return spdy.createServer(serverConfig.ssl, function (req, res) { | ||
var handler = function (req, res) { | ||
var urlPath; | ||
@@ -140,3 +145,6 @@ logger_1.log('server >', req.method, req.url); | ||
} | ||
}); | ||
}; | ||
return serverConfig.forceHttp1 | ||
? http.createServer(handler) | ||
: spdy.createServer(serverConfig.ssl, handler); | ||
} | ||
@@ -143,0 +151,0 @@ Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -20,2 +20,3 @@ import { Readable } from "stream"; | ||
ssl?: Certificate; | ||
forceHttp1?: boolean; | ||
} |
{ | ||
"name": "bundless", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Experimental bundle-free dependency server", | ||
@@ -5,0 +5,0 @@ "main": "./dist/src/index.js", |
Sorry, the diff of this file is not supported yet
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
1218571
35252