const sqlite3 = require('sqlite3');
const { open } = require('sqlite');
const express = require('express');
const router = express.Router();
async function createDB() {
	return await open({
		filename: 'data.sqlite3',
		driver: sqlite3.Database
	});
}
router.get('/', async function (req, res) {
	const db = await createDB();
	const data = await db.all('SELECT * FROM personaldata');
	res.json({
		rows: data
	});
});
module.exports = router;