setup db mariadb and postgres for strapi and next

This commit is contained in:
Schneider Roland
2025-01-07 17:22:14 +01:00
parent bed409f77c
commit a8b144f554
13 changed files with 1088 additions and 28 deletions

13
yoga-app/src/db/db.ts Normal file
View File

@@ -0,0 +1,13 @@
const { Pool } = require('pg');
require ('dotenv').config();
const connectionPool = new Pool({
connectionString: process.env.POSTGRES_URL,
user: process.env.POSTGRES_USER,
host: process.env.POSTGRES_HOST,
database: process.env.POSTGRES_DATABASE,
password: process.env.POSTGRES_PASSWORD,
port: process.env.POSTGRES_PORT,
});
export default connectionPool;