-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: adding models * feat: saving user * refact: users repositories * feat: create tool * feat: find all tools * feat: adding edit and delete endpoints
- Loading branch information
1 parent
3efadcc
commit bf6c21f
Showing
12 changed files
with
364 additions
and
218 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,15 @@ | ||
/* eslint-disable no-console */ | ||
|
||
const { Client } = require("pg"); | ||
const { Sequelize } = require("sequelize"); | ||
|
||
require("dotenv").config(); | ||
|
||
const client = new Client({ | ||
host: process.env.DB_HOST, | ||
port: process.env.DB_PORT, | ||
password: process.env.DB_PW, | ||
user: process.env.DB_USER, | ||
database: process.env.DB_NAME, | ||
ssl: false, | ||
}); | ||
const HOST = process.env.DB_HOST || "localhost"; | ||
const PORT = process.env.DB_PORT || 5432; | ||
const PASS = process.env.DB_PW; | ||
const USER = process.env.DB_USER; | ||
const DATABASE = process.env.DB_NAME; | ||
|
||
client | ||
.connect() | ||
.then(() => console.log("connected")) | ||
.catch((err) => console.error("conection error", err.stack)); | ||
const sequelize = new Sequelize( | ||
`postgres://${USER}:${PASS}@${HOST}:${PORT}/${DATABASE}`, | ||
); | ||
|
||
module.exports = client; | ||
module.exports = sequelize; |
Oops, something went wrong.