Skip to content

Commit

Permalink
adicionando knex
Browse files Browse the repository at this point in the history
  • Loading branch information
pretodev committed Nov 22, 2023
1 parent 06cb58e commit 7c5232e
Show file tree
Hide file tree
Showing 4 changed files with 253 additions and 39 deletions.
210 changes: 210 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"dotenv": "^16.3.1",
"express": "^4.18.2",
"jsonwebtoken": "^9.0.2",
"knex": "^3.0.1",
"pg": "^8.11.3"
},
"devDependencies": {
Expand Down
17 changes: 9 additions & 8 deletions src/conexao.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const { Pool } = require('pg')

module.exports = new Pool({
host: process.env.DB_HOST,
port: process.env.DB_PORT,
user: process.env.DB_USER,
password: process.env.DB_PASSWORD,
database: process.env.DB_NAME,
module.exports = require('knex')({
client: 'pg',
connection: {
host: process.env.DB_HOST,
port: process.env.DB_PORT,
user: process.env.DB_USER,
password: process.env.DB_PASSWORD,
database: process.env.DB_NAME,
}
})
Loading

0 comments on commit 7c5232e

Please sign in to comment.