Skip to content
Browse files

other niceties added

  • Loading branch information...
1 parent f385e63 commit 78d0372d6ed35ace9cbc2c687637550eb80f48bb @coolaj86 coolaj86 committed May 19, 2012
Showing with 7 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +1 −0 .npmignore
  3. +1 −0 bin/dropshare-server.js
  4. +1 −0 package.json
  5. +3 −0 server/lib/index.js
View
1 .gitignore
@@ -4,3 +4,4 @@ files
*.swp
*.swo
config.js
+db.json
View
1 .npmignore
@@ -1,3 +1,4 @@
files
db.json
node_modules
+.git
View
1 bin/dropshare-server.js
@@ -14,6 +14,7 @@
;
console.log("Dropshare listening on http://%s:%d", addr.address, addr.port);
+ console.log("Saving files to " + app.filesDir);
}
/*
View
1 package.json
@@ -37,6 +37,7 @@
, "numeric-buffer": "0.1.x"
, "dom-storage": "1.x"
, "json-storage": "1.x"
+ , "mkdirp": "0.3.x"
},
"devDependencies": {}
}
View
3 server/lib/index.js
@@ -7,6 +7,7 @@
var connect = require('connect')
, fs = require('fs.extra')
+ , mkdirp = require('mkdirp')
, assert = require('assert')
, Futures = require('futures')
, Formaline = require('formaline')
@@ -352,6 +353,7 @@
// Make sure filesDir exists and is writable
try {
+ mkdirp.sync(filesDir);
filesDirStats = fs.statSync(filesDir);
if (!filesDirStats.isDirectory()) {
throw new Error('Storage path is not a directory!');
@@ -387,6 +389,7 @@
// Production
//, connect.errorHandler()
+ app.filesDir = filesDir;
return app;
}

0 comments on commit 78d0372

Please sign in to comment.
Something went wrong with that request. Please try again.