const mysql = require('mysql2');
require('dotenv').config({path: 'C:/Daten/Webshop/process.env'});
//to-do: '.env' Dateien aus anderen Directories aufrufen ohne absoluten Pfad
// require("dotenv").config({path:'C:/Daten/Webshop/process.env'})

const connection = mysql.createConnection({
    host     : process.env.DB_HOST,
    user     : process.env.DB_USER,
    password : process.env.DB_PASSWORD,
    database : process.env.DB_DATABASE
});

connection.connect(function(err) {
    if (err) throw err;
});

module.exports = connection;