Comparing version 0.0.18 to 0.0.19
@@ -11,2 +11,3 @@ console.log(__dirname); | ||
, displayRoutes = require('./display-routes.js') | ||
, bodyParser = require('body-parser') | ||
, cookieParser = require('cookie-parser') | ||
@@ -76,4 +77,7 @@ , cookieSession = require('cookie-session') | ||
// parse data for file upload | ||
app.use(options.apiRoot, multipart()); | ||
app.use(options.apiRoot, multipart()); | ||
// parse data for post data | ||
app.use(options.apiRoot, bodyParser()); | ||
// start session | ||
@@ -88,3 +92,2 @@ app.use(options.apiRoot, cookieParser()); | ||
return function(req, res, next) { | ||
console.log('-------------------------------------'); | ||
var url_parts = urlModule.parse(req.url, true); | ||
@@ -104,3 +107,2 @@ var path = url_parts.path; | ||
url_arr.shift(); | ||
console.log('User request:', url_arr); | ||
// get and remove the service name | ||
@@ -112,4 +114,9 @@ var serviceName = url_arr.shift(); | ||
if (!routed){ | ||
console.error('Unknown service '+serviceName); | ||
if (options.debug) { | ||
console.error('Unknown service '+serviceName); | ||
} | ||
next(); | ||
} else { | ||
console.log('-------------------------------------'); | ||
console.log('User request:', url_arr); | ||
} | ||
@@ -124,3 +131,5 @@ } | ||
catch(e){ | ||
console.error('Error loading service '+serviceName+': '+e); | ||
if (options.debug) { | ||
console.error('Error loading service '+serviceName+': '+e); | ||
} | ||
next(); | ||
@@ -130,2 +139,1 @@ } | ||
} | ||
{ | ||
"name": "unifile", | ||
"description": "Express middleware to provide a common API for cloud storage services. ", | ||
"version": "0.0.18", | ||
"version": "0.0.19", | ||
"author": { | ||
@@ -16,2 +16,3 @@ "name": "Alex Hoyau aka lexoyo" | ||
"connect-multiparty": "~1.0.x", | ||
"body-parser": "~1.0.x", | ||
"cookie-parser": "~1.0.x", | ||
@@ -18,0 +19,0 @@ "cookie-session": "~1.0.x", |
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
105225
2364
11
+ Addedbody-parser@~1.0.x
+ Addedbody-parser@1.0.2(transitive)
+ Addedbytes@1.0.0(transitive)
+ Addedraw-body@1.1.7(transitive)
+ Addedtype-is@1.1.0(transitive)