File tree Expand file tree Collapse file tree 2 files changed +3
-13
lines changed Expand file tree Collapse file tree 2 files changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -38,9 +38,7 @@ DISCORD_SERVER_INVITE=your-discord-server-invite
38
38
PORT=your-custom-backend-port
39
39
SESSION_SECRET=server-session-secret
40
40
BACKEND_SERVER_URL=backend-server-url-without-port
41
- POSTGRES_USERNAME=your-postgres-username (postgres if not changed)
42
- POSTGRES_PASSWORD=your-postgres-password
43
- DB_HOST= (only if you are not using PostgreSQL locally)
41
+ DATABASE_URL=postgres-connection-string (eg. postgres://postgres:postgres@localhost:5432/postgres)
44
42
GRAFANA_TOKEN=your-grafana-authorization-token
45
43
GRAFANA_URL=your-server-url/grafana/your-dashboard-specific-stuff
46
44
GRAFANA_PANEL_ID=your-grafana-panel-id
Original file line number Diff line number Diff line change 1
1
require ( "dotenv" ) . config ( ) ;
2
2
const Sequelize = require ( "sequelize" ) ;
3
- const password = process . env . POSTGRES_PASSWORD ;
4
3
5
- let username = process . env . POSTGRES_USERNAME ;
6
- if ( ! username ) {
7
- username = "postgres" ;
8
- }
4
+ const dbUrl = process . env . DATABASE_URL ;
9
5
10
- const sequelize = new Sequelize ( "postgres" , username , password , {
11
- dialect : "postgres" ,
12
- host : process . env . DB_HOST || "localhost" ,
13
- logging : false ,
14
- } ) ;
6
+ const sequelize = new Sequelize ( dbUrl , { logging : false } ) ;
15
7
16
8
const Course = require ( "./models/Course" ) ( sequelize , Sequelize . DataTypes ) ;
17
9
const Channel = require ( "./models/Channel" ) ( sequelize , Sequelize . DataTypes ) ;
You can’t perform that action at this time.
0 commit comments