diff --git a/.idea/workspace.xml b/.idea/workspace.xml index ac9efb8..37d3182 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -1,14 +1,9 @@ - - - - - + - - + @@ -34,7 +29,11 @@ - + + + + + @@ -92,8 +91,8 @@ - - + + @@ -338,7 +337,25 @@ @@ -370,8 +387,13 @@ + @@ -382,7 +404,11 @@ - + + + + + @@ -444,8 +470,8 @@ - - + + diff --git a/routes/temp.js b/routes/temp.js index 675def5..fb004bf 100644 --- a/routes/temp.js +++ b/routes/temp.js @@ -1,11 +1,20 @@ -var express = require('express'), sqlite3 = require('sqlite3').verbose(); +var express = require('express'), fs = require('fs'), sqlite3 = require('sqlite3').verbose(); var router = express.Router(); var temp_db; +var file = "temp.sqlite3"; +var exists; /* GET users listing. */ function createDB() { console.log('Creating Temp db...'); + + if (!fs.existsSync(file)) { + console.log('creating db file'); + fs.openSync(file,'w'); + } + + temp_db = new sqlite3.Database('temp.sqlite3', createTable); }