Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Forum-Website/modules/home.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
31 lines (25 sloc)
585 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
//const bcrypt = require('bcrypt-promise') | |
//const fs = require('fs-extra') | |
//const mime = require('mime-types') | |
const sqlite = require('sqlite-async') | |
//const saltRounds = 10 | |
//const Forum = require('./forum.js') | |
module.exports = class Home { | |
constructor(dbName = ':memory:') { | |
return (async() => { | |
this.db = await sqlite.open(dbName) | |
return true | |
})() | |
} | |
/** moved to forum.js file **/ | |
/**async getForums() { | |
try { | |
const sql = 'SELECT * FROM forums' | |
const data = await this.db.all(sql) | |
return data | |
} catch (err) { | |
throw err | |
} | |
}**/ | |
} |