Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Commit

Permalink
Use proper DB URL
Browse files Browse the repository at this point in the history
  • Loading branch information
desoindx committed Jan 11, 2022
1 parent e6e1742 commit e8c554f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .env.development
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NEXT_TELEMETRY_DISABLED=1
POSTGRESQL_URL=postgres://monpsysante:monpsysante@localhost:5432/monpsysante
DATABASE_URL=postgres://monpsysante:monpsysante@localhost:5432/monpsysante
DB_LOGGING_ENABLE=true

DEMARCHES_SIMPLIFIEES_TOKEN=api-token
Expand Down
2 changes: 1 addition & 1 deletion .env.staging
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NEXT_TELEMETRY_DISABLED=1
POSTGRESQL_URL=postgres://monpsysante:monpsysante@localhost:5432/monpsysante
DATABASE_URL=postgres://monpsysante:monpsysante@localhost:5432/monpsysante
DB_LOGGING_ENABLE=true


Expand Down
1 change: 0 additions & 1 deletion src/components/Directory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ const Directory = () => {
const [psychologists, setPsychologists] = useState<Psychologist[]>();
const [currentPage, setCurrentPage] = useState(1);
useEffect(() => {
console.log(process.env.NEXT_PUBLIC_DISPLAY_DIRECTORY);
if (process.env.NEXT_PUBLIC_DISPLAY_DIRECTORY !== "true") {
router.push("/");
} else {
Expand Down
8 changes: 3 additions & 5 deletions src/db/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@ dotenv.config();
module.exports = {
development: {
dialect: "postgres",
url: process.env.POSTGRESQL_URL,
url: process.env.DATABASE_URL,
},
production: {
dialect: process.env.POSTGRES_DB_DIALECT,
logging: true,
operatorsAliases: 0,
url: process.env.SCALINGO_POSTGRESQL_URL,
dialect: "postgres",
url: process.env.DATABASE_URL,
},
};
12 changes: 6 additions & 6 deletions src/services/config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const parseBoolean = (value: string) => value === "true";
import * as dotenv from "dotenv";

dotenv.config();

const parseBoolean = (value: string | undefined) => value === "true";

console.log(
process.env.NEXT_PUBLIC_DISPLAY_DIRECTORY,
process.env.NEXT_PUBLIC_DISPLAY_DIRECTORY === "true"
);
export default {
demarchesSimplifiees: {
apiToken: process.env.DEMARCHES_SIMPLIFIEES_TOKEN,
Expand All @@ -15,6 +15,6 @@ export default {
minScoreAddress: parseFloat(process.env.MIN_SCORE_ADDRESS || "0.55"),
postgre: {
logging: parseBoolean(process.env.DB_LOGGING_ENABLE),
url: process.env.POSTGRESQL_URL,
url: process.env.DATABASE_URL || "",
},
};

0 comments on commit e8c554f

Please sign in to comment.