develop #26
3
.gitignore
vendored
3
.gitignore
vendored
@ -104,7 +104,6 @@ dist
|
||||
|
||||
# vuepress v2.x temp and cache directory
|
||||
.temp
|
||||
.cache
|
||||
|
||||
# Docusaurus cache and generated files
|
||||
.docusaurus
|
||||
@ -132,3 +131,5 @@ dist
|
||||
.pnp.*
|
||||
|
||||
/.idea/git_toolbox_blame.xml
|
||||
.package.json
|
||||
.package-lock.json
|
||||
@ -1,5 +1,7 @@
|
||||
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,
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
require('mysql2')
|
||||
var connection = require('./db-connect')
|
||||
connection.query("SELECT * FROM webshop.user WHERE ID = 15", function (err, result) {
|
||||
|
||||
let appRoot = require('app-root-path')
|
||||
let dbConnect = require(appRoot + '/scripts/modules/db-connect.js')
|
||||
|
||||
dbConnect.query("SELECT * FROM webshop.user WHERE ID = 0", function (err, result) {
|
||||
if (err) throw err
|
||||
console.log(result)
|
||||
})
|
||||
connection.end()
|
||||
|
||||
// require("dotenv").config({path:'C:/Daten/Webshop/process.env'})
|
||||
dbConnect.end()
|
||||
Loading…
x
Reference in New Issue
Block a user