more experiments with connected back end structure

This commit is contained in:
Mikayla Dobson
2022-07-05 12:30:06 -05:00
parent f1d964b092
commit 20d704851f
6 changed files with 66 additions and 38 deletions

View File

@@ -5,6 +5,7 @@ const pool = new Pool({ connectionString: process.env.CONNECTION });
module.exports = {
// text = SQL query; params = array of values to inject
pool,
connect: async () => await pool.connect().then(console.log("Connection successful.")),
query: (text, params) => pool.query(text, params),
end: async () => await pool.end()