diff --git a/README.md b/README.md index d4b7c091..ba5565ef 100644 --- a/README.md +++ b/README.md @@ -10,3 +10,7 @@ Check [DrawSQL](https://drawsql.app/teams/no-sim/diagrams/space) - [`pg`](https://node-postgres.com/) - [`node-pg-migrate`](https://salsita.github.io/node-pg-migrate/getting-started) + +https://gist.github.com/Oleshkooo/a403dc8b85e98070fb39844dfb3c0208 +https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04 +https://docs.vultr.com/how-to-configure-apache-as-a-reverse-proxy-with-mod-proxy-54152 diff --git a/server/src/constants.ts b/server/src/constants.ts index a253d789..d68b4ec5 100644 --- a/server/src/constants.ts +++ b/server/src/constants.ts @@ -23,11 +23,11 @@ const schema = { } as const; export const databaseConnection = { - user: isDev ? "postgres" : schema.string.parse(process.env.PG_USER), - password: isDev ? "litespace" : schema.string.parse(process.env.PG_PASSWORD), - host: isDev ? "localhost" : schema.string.parse(process.env.PG_HOST), - port: isDev ? 5432 : schema.number.parse(process.env.PG_PORT), - database: isDev ? "litespace" : schema.string.parse(process.env.PG_DATABASE), + user: schema.string.parse(process.env.PG_USER), + password: schema.string.parse(process.env.PG_PASSWORD), + host: schema.string.parse(process.env.PG_HOST), + port: zod.coerce.number().parse(process.env.PG_PORT), + database: schema.string.parse(process.env.PG_DATABASE), url: zod .string({ message: "Missing or invalid database url" }) .startsWith("postgres://")