server for my chess game
Diffstat (limited to 'src/pg.js')
-rw-r--r--src/pg.js9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/pg.js b/src/pg.js
index a32abf8..ccbd150 100644
--- a/src/pg.js
+++ b/src/pg.js
@@ -1,4 +1,5 @@
-const { Pool } = require("pg");
+import pg from "pg";
+const { Pool } = pg;
const pool = new Pool({
connectionString: process.env.DATABASE_URL,
@@ -9,7 +10,7 @@ pool.on("error", (err, client) => {
console.error("Error:", err);
});
-async function command(command) {
+export async function command(command) {
let client;
try {
client = await pool.connect();
@@ -21,7 +22,3 @@ async function command(command) {
client.release();
}
}
-
-module.exports = {
- command: command,
-};