Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bc. Michael Heiland
AffinityAnalytics-Automated_Appointment_Assistant
Commits
a2eac148
Commit
a2eac148
authored
Nov 09, 2017
by
Vincent Horvath
Browse files
fixed db connection configuration
parent
6e6860a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
anton/app/services/database.js
View file @
a2eac148
...
...
@@ -2,9 +2,9 @@ var mysql = require('mysql');
var
connection
=
null
;
module
.
exports
=
{
getConnection
:
function
(
localConfig
)
{
getConnection
:
function
()
{
if
(
connection
==
null
)
{
connection
=
mysql
.
createConnection
(
getConfiguration
(
localConfig
));
connection
=
mysql
.
createConnection
(
getConfiguration
());
connection
.
connect
(
function
(
err
)
{
if
(
!
err
)
{
console
.
log
(
"
Database is connected ...
"
);
...
...
@@ -18,7 +18,7 @@ module.exports = {
}
};
function
getConfiguration
(
localConfig
)
{
function
getConfiguration
()
{
if
(
process
.
env
.
PRODUCTION
)
{
return
{
host
:
process
.
env
.
DB_HOST
,
...
...
@@ -27,7 +27,7 @@ function getConfiguration(localConfig) {
database
:
process
.
env
.
DB_SCHEMA
,
};
}
else
{
return
localConfig
return
require
(
'
../conig/main-local.json
'
).
db
;
}
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment