Skip to content

Commit

Permalink
Update lib/middleware.js
Browse files Browse the repository at this point in the history
Remove mkdir, which resulted in errors on some platforms.
  • Loading branch information
jhvst committed Jan 9, 2013
1 parent aa905f9 commit 682e5c5
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ var fs = require('fs')
* Initialize
*/

fs.mkdir('./analytics-logs', function(err) {
if (err) console.log(err);
});

var db = {}
, pageviews = 1;

Expand Down Expand Up @@ -107,9 +103,9 @@ function counter (index, root) {
*/

var save = function () {
fs.writeFile('./analytics-logs/' + moment().format('LL') + '.txt', JSON.stringify(db), function (err) {
fs.writeFile(moment().format('LL') + '.txt', JSON.stringify(db), function (err) {
if (err) throw err;
console.log('Analytics saved to file ./analytics-logs/' + moment().format('LL') + '.txt');
console.log('Analytics saved to file ' + moment().format('LL') + '.txt');
});
};

Expand Down

0 comments on commit 682e5c5

Please sign in to comment.