create the level db folder if it does not exists

pull/6/head
Jérôme Loï 10 years ago
parent 5f52ab39bf
commit 023d1b039a

@ -25,6 +25,7 @@
"dependencies": {
"browserify": "^5.11.2",
"domready": "^1.0.7",
"level": "^0.18.0",
"nodemailer": "^1.3.0",
"valid-email": "0.0.1",
"xss-escape": "0.0.5"

@ -9,6 +9,15 @@ var server = require('http').createServer(handler)
, db = require('level')('./db/squatconf', { valueEncoding: 'json' })
, port = process.env.PORT || /*80*/ 8000
// create the level db folder if it does not exists
if(!fs.existsSync('./db/squatconf')){
fs.mkdirSync('./db/squatconf', 0766, function(err){
if(err){
console.log(err);
}
});
}
function handler(req, res) {
// process incoming requests.

Loading…
Cancel
Save