-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated documentation and customizability of exchages
Apologies as documentation did not mention anything about database migrations. Also added a check to see if database is connected. If connections fails, suggestions will be outputted. You can now disable exchanges if exchanges if you don't want data from them. This is still a work in progress, and the implementation isn't the cleanest but it works. Ideally I would want to ignore if an exchange is unable to get data for a certain cryptocurrency. Any help would be appreciated.
- Loading branch information
Showing
7 changed files
with
591 additions
and
2,802 deletions.
There are no files selected for viewing
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
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,4 +1,14 @@ | ||
require('dotenv').config(); | ||
const pg = require("pg-promise")(); | ||
const db = pg(process.env.DATABASE_URL); | ||
let db; | ||
try { | ||
db = pg(process.env.DATABASE_URL); | ||
console.log('\033[92m\u2713\033[0m DB connected'); | ||
} catch { | ||
console.log('\033[91m\u2717\033[0m Could not connect to database.'); | ||
console.log('Please make sure you have run \'npm run db:migrate\' first'); | ||
console.log('Also, make sure correct environment variables are set.'); | ||
process.exit(1); | ||
} | ||
|
||
module.exports = db; |
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
Oops, something went wrong.